Mc *_*0's 6 sublimetext3 angular
我尝试在Windows上的Angular 2中基于以下存储库启动一个新项目:https://github.com/mgechev/angular2-seed
一切正常(npm install,npm start...),但Sublime Text 3显示了我执行项目时不存在的一些错误.
以下是我遵循的步骤:
$ git clone https://github.com/mgechev/angular2-seed.git
$ cd angular2-seed
$ npm install
Run Code Online (Sandbox Code Playgroud)
然后我用Sublime Text(使用TypeScript包)打开项目,我在代码中面临一些错误/警告.
具有@Component装饰器的类显示以下错误:
对装饰器的实验性支持是一个在将来的版本中可能会发生变化的功能.设置'experimentalDecorators'选项以删除此警告.
(它忽略线"experimentalDecorators": true在tsconfig.json)
例如,在src/client/app/about/about.component.ts中,在行上:
moduleId: module.id,
Run Code Online (Sandbox Code Playgroud)
Sublime显示此错误:
找不到名称'模块'.
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "es2015", "dom"],
"sourceMap": true,
"pretty": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"typeRoots": [
"./node_modules/@types",
"./node_modules"
],
"types": [
"node"
]
},
"exclude": [
"node_modules",
"dist",
"src"
],
"compileOnSave": false
}
Run Code Online (Sandbox Code Playgroud)
https://github.com/mgechev/angular2-seed/blob/27db8a19f70470f5110482df1a4debc1100ec347/package.json
你为什么我有这2个错误?我可以发展,但不是很愉快.
Mc *_*0's 20
由于这个链接,我解决了我的问题:https://github.com/Microsoft/TypeScript-Sublime-Plugin/issues/470
总结一下:
"typescript_tsdk": "C:/...../npm/node_modules/typescript/lib",使用适当的链接)module.id| 归档时间: |
|
| 查看次数: |
3409 次 |
| 最近记录: |