Javascript 编译错误-找不到名称';地图'&;多角度2
我的角度项目有问题。它是在没有Angular CLI的情况下开发的,现在我遇到了这些错误,因为它似乎在collection.d.ts中找不到类: 等等。 我的tsconfig.json如下所示:Javascript 编译错误-找不到名称';地图'&;多角度2,javascript,angular,typescript,config,tsconfig,Javascript,Angular,Typescript,Config,Tsconfig,我的角度项目有问题。它是在没有Angular CLI的情况下开发的,现在我遇到了这些错误,因为它似乎在collection.d.ts中找不到类: 等等。 我的tsconfig.json如下所示: { "compilerOptions": { "target": "es2015", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetada
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "build/",
"skipLibCheck": true,
"lib": [ "es6","dom" ]
},
"compileOnSave": true]
}
我已经在线搜索了一个解决方案,目标是es6、es5或添加其他lib属性。
解决?
谢谢尝试以下组合:
“目标”:“es5”,
“lib”:[“es5”、“es6”、“es7”、“DOM”],
如果不起作用,请尝试npm安装--保存dev@types/core js
您运行的是哪个Angular和CLI版本?请提供整个堆栈跟踪?可能问题与该tsconfig没有具体关系。听起来与此非常相关:在我的例子中,map操作符是一个rxjs操作符,对于rxjs6,我必须使用以下命令手动导入它:import{map}from'rxjs/operators';事实证明,reactivex和types/core js都存在问题
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "build/",
"skipLibCheck": true,
"lib": [ "es6","dom" ]
},
"compileOnSave": true]
}