我是一个node
和express
的新手。
我已经在我的Ubuntu 13.10机器上安装了node和npm。现在,我正在尝试使用以下命令全局安装express
(我遵循官方网站上的指示)。
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
../lib/node_modules/express/bin/express
的东西吗? - SheetJS/usr/bin/express
是链接到../lib/.../express
的符号链接。那现在缺少什么呢? - ajdukeUbuntu 13.04
,通过执行nodejs --version
命令,我得到的是v0.10.12
。 - ajdukenode --version
会输出什么?一些发行版将二进制文件名更改为nodejs
,但是脚本通常依赖于node
(由于历史原因——在nodejs
出现之前,node
是一个非常古老的工具)。 - SheetJS