Using typescript@next nightly package? Don’t rely on –save-dev to be up-to-date!

September 04, 2015

Just a small update for all you cutting edge TypeScript users.

If you are using typescript@next NPM package as showed here : http://blogs.msdn.com/b/typescript/archive/2015/07/27/introducing-typescript-nightlies.aspx you may run into the same issue as we did @ work.

If you would install TypeScript nightly as blog says like this (I modified the command, this will install typescript@next package locally and save dependency in devDependencies):

npm install typescript@next –save-dev

you would see something like this in your package.json (please note the date 20150818 suffix)

{
"devDependencies": {  "typescript": "^1.6.0-dev.20150818"  }
}

Which is OK, and also

npm update

will work, until TypeScript recently updated to version 1.7.0 which will update you to latest 1.6.0 verions, which is typescript@1.6.0-dev.20150825.

If you would delete the folder with TypeScript in node_modules and also entry in package.json and reinstall typescript@next package, then you would have this entry in package.json (if installed on 1.9.2015) :

{
"devDependencies": { "typescript": "^1.7.0-dev.20150901" }
}

which will again work until TS updated to 1.8.0. You can try to npm update with this file, you will be updated to latest 1.7.0.

So, what can we do about this? You might try this small “hack” :

{
"devDependencies": { "typescript": "next" }
}

Happy npm update-ing 😉

Hope this helps.


Profile picture

Written by Dušan Roštár - the "mr edge case" guy
my twitter : rostacik, my linkedin : rostar, drop me an email : here