Version problem when installing express

  node.js, question

I usenpm install express -gAndnpm install express-generator -gAfter the installation is successful, the version of 4.8 is displayed, but when I use express -v to view the version, it is 2.5.8. What is the reason for this? The project I generate using express blog is also the version of 2.x. How to solve it?
Npm install express has been restarted many times.

The system is ubuntu

First, generallyexpress-generatorGlobal installation, whileexpressLocal installation is sufficient (under the project).

Express-generator is used for express project skeleton. Although the running command is express, it is actually the express-generator package.

Second, runwhich expressLook, express here isexpressThis bag, orexpress-generatorThis bag.

It is suggested that the overall situationexpressUnload it.

npm uninstall -g express