我是node
和express
我确实在我的ubuntu 13.10机器上安装了节点和npm。现在,我尝试使用以下命令全局安装express
(我按照official site上的说明进行操作)
sudo npm install express -g
但是当我想要做的时候
express --help
或
express
它在shell中没有提供任何内容
执行sudo npm install express -g
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mkdirp/0.3.4
npm http GET https://registry.npmjs.org/buffer-crc32/0.2.1
npm http GET https://registry.npmjs.org/cookie/0.1.0
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/cookie-signature/1.0.1
npm http GET https://registry.npmjs.org/connect/2.7.11
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http 304 https://registry.npmjs.org/cookie/0.1.0
npm http 304 https://registry.npmjs.org/mkdirp/0.3.4
npm http 304 https://registry.npmjs.org/buffer-crc32/0.2.1
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm WARN package.json range-parser@0.0.4 No repository field.
npm http 304 https://registry.npmjs.org/fresh/0.1.0
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/send/0.1.0
npm http 304 https://registry.npmjs.org/cookie-signature/1.0.1
npm WARN package.json fresh@0.1.0 No repository field.
npm http 304 https://registry.npmjs.org/connect/2.7.11
npm WARN package.json send@0.1.0 No repository field.
npm WARN package.json cookie-signature@1.0.1 No repository field.
npm http 304 https://registry.npmjs.org/methods/0.0.1
npm WARN package.json methods@0.0.1 No repository field.
npm WARN package.json methods@0.0.1 No readme data.
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/cookie/0.0.5
npm http GET https://registry.npmjs.org/send/0.1.1
npm http GET https://registry.npmjs.org/qs/0.6.5
npm http GET https://registry.npmjs.org/formidable/1.0.14
npm http GET https://registry.npmjs.org/bytes/0.2.0
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/bytes/0.2.0
npm WARN package.json bytes@0.2.0 No repository field.
npm http 304 https://registry.npmjs.org/cookie/0.0.5
npm http 304 https://registry.npmjs.org/formidable/1.0.14
npm http 304 https://registry.npmjs.org/qs/0.6.5
npm http 304 https://registry.npmjs.org/send/0.1.1
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm WARN package.json pause@0.0.1 No repository field.
npm http GET https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/mime
/usr/bin/express -> /usr/lib/node_modules/express/bin/express
npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm WARN package.json assert-plus@0.1.2 No repository field.
npm WARN package.json ctype@0.5.2 No repository field.
express@3.2.6 /usr/lib/node_modules/express
├── methods@0.0.1
├── fresh@0.1.0
├── range-parser@0.0.4
├── cookie-signature@1.0.1
├── buffer-crc32@0.2.1
├── cookie@0.1.0
├── debug@0.7.2
├── commander@0.6.1
├── mkdirp@0.3.4
├── send@0.1.0 (mime@1.2.6)
└── connect@2.7.11 (pause@0.0.1, bytes@0.2.0, qs@0.6.5, cookie@0.0.5, formidable@1.0.14, send@0.1.1)
我有什么事吗?
更新
我正在使用nodejs
版本v0.10.12
答案 0 :(得分:12)
你必须运行
npm install -g express-generator
这会下载更多东西,之后应该会有明确的命令。
答案 1 :(得分:3)
由@Nirk用户引用
某些发行版将二进制名称更改为nodejs,但脚本经常更改 依赖于节点(由于历史原因 - 节点是一个非常古老的工具 在nodejs出现之前
在/usr/lib/node_modules/express/bin/express
文件的第一行中进行了以下手动更改。
来自
#!/usr/bin/env node
到
#!/usr/bin/env nodejs
现在它正在为我工作
@Nirk,非常感谢支持人员