Walter_Wally
Walter_Wally

Reputation: 15

Mac OS X, Node is installed by Nvm, but can't use module which is installed globally

The operation system is Mac OS X, After installing Node by using NVM, Node -v shows 9.2. And after installing express globally(npm install -g express), I cannot use express in the command line. If it is used, it will prompt that the module is not defined. Using npm root -g to find the installation of node path, in the lib or bin directory I can see the global installation of the package, but I can't be able to add lib or bin directory in the environment path, because there is no executable file in these two directories. Any suggestions are very helpful, thanks.

Upvotes: 0

Views: 561

Answers (1)

Michael Hulet
Michael Hulet

Reputation: 3494

The command-line program express is not installed with npm install express, no matter the command line parameters passed to it. To use the command line utility, you must globally install the package express-generator, like this:

npm install -g express-generator

You also should probably install normal express to your individual project, and not globally

Upvotes: 1

Related Questions