Martin
Martin

Reputation: 24308

Express.JS installed globally isn't found on Windows

I have tried installing express-generator via global but it's not found.

I have tried opening a new CMD / Powershell and same thing happens.

PS C:\Users\testuser\testme> npm install -g express-generator
npm http GET https://registry.npmjs.org/express-generator
npm http 304 https://registry.npmjs.org/express-generator
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/minimist
C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.31\tools\express -> C:\ProgramData\chocolatey\
lib\nodejs.commandline.0.10.31\tools\node_modules\express-generator\bin\express
[email protected] C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.31\tools\node_modules\
express-generator
├── [email protected] ([email protected])
└── [email protected] ([email protected])
PS C:\Users\testuser\testme> express
express : The term 'express' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1
+ express
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (express:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\testuser\testme>

This has been installed globally.

Any ideas?

Upvotes: 1

Views: 2314

Answers (1)

Matthew Bakaitis
Matthew Bakaitis

Reputation: 11990

Check your PATH to be sure it includes the location for globally installed modules.

At a command prompt:

  1. type npm ls -g --depth=0 and note the directory printed on the first line of output
  2. type PATH to see if the directory found in step #1 is in the path...

If (when) the npm global install directory is missing from your PATH, adding it should fix the problem.

See this other StackOverflow question as a reference: Grunt on Windows 8: 'grunt' is not recognized

Upvotes: 2

Related Questions