app.compoent.ts you'll see: [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 AppComponentlib, typeRoots and types from tsconfig.json made the warning go away.vscode uses an internal copy of typescript which is currently at version 1.8.x. CLI-based projects use typescript 2.0. The project will build fine with the CLI. vscode just doesn't understand the new options.
To make vscode use the project's typescript, add a workspace settings file in vscode and add the following setting: "typescript.tsdk": "./node_modules/typescript/lib". (the path may need to be changed depending on your setup)
@clydin - tried it with no effect. Just wonder when the decorator feature will be coming out of experimental status. Perhaps after release 1.0 of Angular?
@clydin trick works on my environnement
Related: https://github.com/Microsoft/vscode/issues/9232#issuecomment-234676233
@un33k Since you used the --skip-npm option, you won't have a local install of typescript. You'll either need to manually run npm install or point the setting to the location of your globally installed version (make sure it's 2.0). If you need the global npm install path, run npm root -g.
See answer in https://github.com/Microsoft/vscode/issues/9232#issuecomment-237544038 (basically what @clydin said).
un33K it worked for me with workspace setting:
"typescript.tsdk": "node_modules/typescript/lib"
so no ./ in front of node_modules
and do a ">reload window" in the command panel of visual studio code
Go to File > Preferences > Workspace Settings then add the below to settings.json
// Place your settings in this file to overwrite default and user settings.
{
"typescript.tsdk": "./node_modules/typescript/lib"
}
Then go to View > Command Palette > type "reload window" in panel and press enter.
Above trick works for me.
napster are you a repeat box?
@clydin solution works. Using latest version of TypeScript and Angular 2 final release
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
vscode uses an internal copy of typescript which is currently at version 1.8.x. CLI-based projects use typescript 2.0. The project will build fine with the CLI. vscode just doesn't understand the new options.
To make vscode use the project's typescript, add a workspace settings file in vscode and add the following setting:
"typescript.tsdk": "./node_modules/typescript/lib". (the path may need to be changed depending on your setup)