Win*_*cca 11 json visual-studio-code
我正在使用我的角度2启动项目获得视觉工作室代码.
我已经设置了我的tsconfig.json ...
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
Run Code Online (Sandbox Code Playgroud)
我立即遇到了这个错误
[ts] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
class AppComponent
Run Code Online (Sandbox Code Playgroud)
我无法确定发生了什么,所以我运行了一个构建并得到了这个错误.
error TS5057: Cannot find a tsconfig.json file at the specified directory: '.'
Run Code Online (Sandbox Code Playgroud)
此错误解释了为什么我收到有关组件装饰器的错误,但我不确定为什么找不到tsconfig.json文件.
我只有一个文件夹,它包含除index.html,package.json和.gitignore之外的所有内容.
meD*_*Dev 10
我得到了类似的错误.通过更改tasks.json中的以下行来解决
"args": ["-p", "."],
至
"args": ["-p", "./src"],
在我的情况下tsconfig.json是在src文件夹中.Angular 2项目是使用angular-cli创建的.