首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows上找不到全局安装的Express.JS

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

Stack Overflow用户
提问于 2014-12-03 12:49:34
回答 1查看 2.2K关注 0票数 1

我试过通过全局安装快件生成器,但找不到。

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

代码语言:javascript
复制
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>

这已在全球范围内安装。

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-04 07:45:45

检查您的PATH以确保它包括全局安装模块的位置。

在命令提示符下:

  1. 键入npm ls -g --depth=0并注意输出第一行上的目录
  2. 键入PATH以查看步骤#1中找到的目录是否在路径中.

如果(当) npm全局安装目录从您的PATH中丢失,那么添加它应该可以修复这个问题。

查看另一个StackOverflow问题作为参考:Grunt on Windows 8: 'grunt' is not recognized

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27272179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档