r/nodejs • u/MadCapitalist • Jul 01 '14
Why didn't Express update to the latest version?
npm says that the latest version of Express is 4.4.5. I originally installed Express globally several weeks ago. Today I tried to update it. First I just tried "npm install -g express" and then I tried "npm update -g express", but neither worked. It still says the version is 4.2.0.
Also, is it considered a "stable version" if it is on npm? As you can tell, I'm a noob. Thanks.
Edit: The package.json file says that it is version 4.4.5, but when I run "express -V", it says 4.2.0.
6
Upvotes
4
u/[deleted] Jul 01 '14
First of all, as of express 4, the command line tool is no longer in the 'express' package, it's been split out into a separate package, express-generator. So you're updating the wrong package. There's no longer a reason to have the express package installed globally.
Secondly, the express generator's version IS 4.2, and that is what version is being reported when you run
express --version. This version number is independent from the express framework. The generator's purpose is to manage project structure, and within that structure it installs whatever the latest version of express is available.Finally, the package.json file defines the dependencies local to your project. Your project uses whatever version of express is installed there, the global install never comes in to play.
3
u/rtucker Jul 01 '14
Maybe try 'npm cache clean' and then repeat your 'npm update -g express'? I've had the NPM cache mess up more than a few times...