在Windows上找不到全局安装的Express.JS

我已经尝试通过全球安装快递发电机,但没有find。 谁能帮忙?

我试图打开一个新的CMD / Powershell,同样的事情发生。

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 express-generator@4.9.0 C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.31\tools\node_modules\ express-generator ├── commander@1.3.2 (keypress@0.1.0) └── mkdirp@0.5.0 (minimist@0.0.8) 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> 

这已经在全球安装。

有任何想法吗 ?

检查你的PATH ,确保它包含全球安装模块的位置。

在命令提示符下:

  1. 键入npm ls -g --depth=0并记下第一行输出中打印的目录
  2. 键入PATH以查看在步骤#1find的目录是否在path中…

如果(当) PATH缺lessnpm全局安装目录,则添加它应该可以解决问题。

看到这个其他的StackOverflow问题作为参考: 在Windows 8上的Grunt:不能识别“grunt”