window7 安装express总是不成功
发布于 9个月前 作者 LyleLee 454 次浏览

最近想换成在window下写nodejs,想安装express,可以一直不成功。用express命令创建工程的时候, 提示命令不存在。 ‘express’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

一下是命令运行结果: C:\Users\Administrator>node -v v0.10.28 C:\Users\Administrator>npm -v 1.4.9 C:\Users\Administrator>npm install -g express npm http GET https://registry.npmjs.org/express npm http 304 https://registry.npmjs.org/express npm http GET https://registry.npmjs.org/accepts npm http GET https://registry.npmjs.org/type-is npm http GET https://registry.npmjs.org/range-parser npm http GET https://registry.npmjs.org/buffer-crc32 npm http GET https://registry.npmjs.org/cookie npm http GET https://registry.npmjs.org/methods npm http GET https://registry.npmjs.org/send npm http GET https://registry.npmjs.org/fresh npm http GET https://registry.npmjs.org/cookie-signature npm http GET https://registry.npmjs.org/merge-descriptors npm http GET https://registry.npmjs.org/utils-merge npm http GET https://registry.npmjs.org/escape-html npm http GET https://registry.npmjs.org/qs npm http GET https://registry.npmjs.org/serve-static npm http GET https://registry.npmjs.org/path-to-regexp npm http GET https://registry.npmjs.org/debug npm http GET https://registry.npmjs.org/parseurl npm http 304 https://registry.npmjs.org/cookie npm http 304 https://registry.npmjs.org/buffer-crc32 npm http 304 https://registry.npmjs.org/accepts npm http 304 https://registry.npmjs.org/methods npm http 304 https://registry.npmjs.org/send npm http 304 https://registry.npmjs.org/fresh npm http 304 https://registry.npmjs.org/cookie-signature npm http 304 https://registry.npmjs.org/merge-descriptors npm http 304 https://registry.npmjs.org/utils-merge npm http 304 https://registry.npmjs.org/escape-html npm http 304 https://registry.npmjs.org/serve-static npm http 304 https://registry.npmjs.org/qs npm http 304 https://registry.npmjs.org/parseurl npm http 304 https://registry.npmjs.org/debug npm http 304 https://registry.npmjs.org/path-to-regexp npm http 304 https://registry.npmjs.org/type-is npm http 304 https://registry.npmjs.org/range-parser npm http GET https://registry.npmjs.org/mime npm http GET https://registry.npmjs.org/negotiator npm http GET https://registry.npmjs.org/mime npm http 304 https://registry.npmjs.org/mime npm http 304 https://registry.npmjs.org/negotiator npm http 304 https://registry.npmjs.org/mime express@4.2.0 C:\Users\Administrator\AppData\Roaming\npm\node_modules\express ├── parseurl@1.0.1 ├── merge-descriptors@0.0.2 ├── utils-merge@1.0.0 ├── cookie@0.1.2 ├── escape-html@1.0.1 ├── cookie-signature@1.0.3 ├── debug@0.8.1 ├── range-parser@1.0.0 ├── fresh@0.2.2 ├── qs@0.6.6 ├── methods@1.0.0 ├── buffer-crc32@0.2.1 ├── serve-static@1.1.0 ├── path-to-regexp@0.1.2 ├── send@0.3.0 (debug@0.8.0, mime@1.2.11) ├── type-is@1.1.0 (mime@1.2.11) └── accepts@1.0.1 (negotiator@0.4.3, mime@1.2.11)

C:\Users\Administrator>express myapp ‘express’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

其中path是这样的, C:\Users\Administrator>echo %path% D:\Python33;C:\Program Files\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:
Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Fil es\ATI Technologies\ATI.ACE\Core-Static;D:\Program Files\MATLAB\R2010b\runtime\w in32;D:\Program Files\MATLAB\R2010b\bin;C:\Program Files\Windows Kits\8.0\Window s Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;D:
Program Files\TortoiseSVN\bin;D:\Program Files\nodejs;D:\Program Files\Java\jdk 1.6.0_27\bin;D:\Program Files\Java\jdk1.6.0_27\jre\bin;D:\Python33;D:\Program Fi les\opencv\build\x86\vc11\bin;C:\Users\Administrator\AppData\Roaming\npm

可以看到是有npm路径在path当中的。

这是什么问题,在网上找了很久都没有找到解决办法,希望好心人告知。

2 回复

express-generator

1楼正解,express4.X开始需要用构建器构建应用。 先安装 express-generator npm install express-generator -g

回到顶部