The web site builds and runs just fine - I'm not using Sublime Text 3 to build and run - but I'd really like that warning to go away and anticipate problems with other settings in the future if I can't get the Sublime TypeScript plug-in to use my tsconfig.json file.
#Sublime text 3 typescript install#
Since this is the default directory structure created by angular-cli and I'm using a clean install of Sublime Text 3 (Build 3126), it seems to me that a lot of folks will run into this problem in the future. If it matters, I was cd's to the enclosing angular2_hello_world/ folder when I entered the command 'subl. Set the 'experimentalDecorators' option to remove this warning.īut that option is set to true in the tsconfig.json file, so I have to assume that my tsconfig.json is not being used. When I open the source file, I see this error: Experimental support for decorators is a feature that is subject to change in a future release.
That is, my tsconfig.json is in the src/ folder, but outside the app/ folder. Which sets up this directory structure: angular2_hello_world/ You have to restart sublime for the changes to take effect. "typescript_proc_file": "C:/Users/admin/AppData/Roaming/npm/node_modules/typescript/lib/tsserver.js" The solution is to set the 'typescript_proc_file' settings in your sublime-settings file (Preferences -> Settings - User) to the globally installed tsserver.js file. The plugin uses an IO wrapper around the TypeScript language services to provide an enhanced Sublime Text experience when working with TypeScript code. In the next command palette window type TypeScript and hit enter. You can use the arrow keys to navigate the list quicker and press enter on the right item rather than typing everything. This is because the tsserver.js from TypeScript-Sublime-Plugin doesn't recognize some options in the tsconfig.json, like emitDecoratorMetadata for example. Press Ctrl+Shift+P to bring up the command palette and type in Package Control: Install Package and press enter.
ts files, it would give me the same error:Ĭannot compile modules unless the '-module' flag is providedīut running tsc on the command-line would not. Since the global typescript tsserver.js wasn't used for checking. The problem was that it wasn't the same version as the typescript that I had installed globally from npm.
ts file.Īfter analyzing what happened, I realized that the TypeScript-Sublime-Plugin uses it's own internal tsserver.js installed with it. I had the same problem I would get the error no matter where I would place a.