Deprecated version of express doesn't upgrade

Posted November 24, 2014 4.1k views

The version of express in the MEAN stack remains 2.5.8 which is supposed to be deprecated. How do I get it to release 3.x.x or higher ?

I have tried

npm install -g express@3.x.x

and the feedback is that it is installing 3.18.4

/usr/local/bin/express -> /usr/local/lib/node_modules/express/bin/express 
express@3.18.4 /usr/local/lib/node_modules/express

but then after successful install still version 2.5.8 is shown

root@olivettatest:~/projects/getting-MEAN# express --version 

Anybody any Idea ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

What’s the output of which express ? You seem to have another version installed somewhere on your PATH I suspect you may have installed the version directly from the Ubuntu repositories.

The MEAN sample project installed to /opt/mean on the DigitalOcean one-click app currently installs express 4.9.7:

head -n 1 /opt/mean/node_modules/express/ 
4.9.7 / 2014-10-10

With express >= 4.0 the command line tool has move to the express-generator package. It can be installed with:

npm install -g express-generator

Here’s the output of that command:

/usr/local/bin/express -> /usr/local/lib/node_modules/express-generator/bin/express
express-generator@4.9.0 /usr/local/lib/node_modules/express-generator
├── mkdirp@0.5.0 (minimist@0.0.8)
└── commander@1.3.2 (keypress@0.1.0)
root@mean-test:/opt/mean# which express
root@mean-test:/opt/mean# express --version