请教关于express的generator的运行出错的问题
发布于 3个月前 作者 macrotea 634 次浏览 来自 分享

1.这是官方的运行指南: https://github.com/expressjs/generator

2.我在windows下的操作过程:

E:>npm install -g express-generator npm http GET https://registry.npmjs.org/express-generator npm http 200 https://registry.npmjs.org/express-generator npm http GET https://registry.npmjs.org/express-generator/-/express-generator-4.9.0.tgz npm http 200 https://registry.npmjs.org/express-generator/-/express-generator-4.9.0.tgz npm http GET https://registry.npmjs.org/commander/1.3.2 npm http GET https://registry.npmjs.org/mkdirp/0.5.0 npm http 304 https://registry.npmjs.org/commander/1.3.2 npm http 304 https://registry.npmjs.org/mkdirp/0.5.0 npm http GET https://registry.npmjs.org/keypress npm http GET https://registry.npmjs.org/minimist/0.0.8 npm http 304 https://registry.npmjs.org/keypress npm http 304 https://registry.npmjs.org/minimist/0.0.8 C:\Users\Lenovo\AppData\Roaming\npm\express -> C:\Users\Lenovo\AppData\Roaming\npm\node_modules\express-generator\bin\express [email protected] C:\Users\Lenovo\AppData\Roaming\npm\node_modules\express-generator ├── [email protected] ([email protected]) └── [email protected] ([email protected])

E:>express /tmp/foo && cd /tmp/foo ‘express’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

E:>express -h ‘express’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

E:>

2.发现当输入express命令则出错,如何绑定或者让命令行发现这个express命令,请赐教!

4 回复

全局安装要配置环境变量,或者在命令行需要配置环境变量

难道是expressjs? 绑定命令直接ln -s

路径添加到环境变量里

@flex1988 @ChopperLee2011 @hpgt 感谢指导,确实要添加路径: C:\Users\Lenovo\AppData\Roaming\npm 到环境变量中, 可能是我之前的一些操作导致环境变量的配置丢失了!谢谢指导!

回到顶部