Express NPM安装快车。错误:找不到兼容的版本

Express NPM安装快车。错误:找不到兼容的版本,express,installation,npm,Express,Installation,Npm,我的操作系统是Ubuntu 13.04,32位 我正在尝试使用以下命令安装express: $ npm install express 这就是我得到的错误: npm http GET https://registry.npmjs.org/express npm http GET https://registry.npmjs.org/express npm http 304 https://registry.npmjs.org/express npm ERR! Error: No compati

我的操作系统是Ubuntu 13.04,32位

我正在尝试使用以下命令安装express:

$ npm install express
这就是我得到的错误:

npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm ERR! Error: No compatible version found: express@'>=4.0.0-0'
npm ERR! Valid install targets:
npm ERR! ["0.14.0","0.14.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","2.0.0","2.1.0","2.1.1","2.2.0","2.2.1","2.2.2","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.3.9","2.3.10","2.3.11","2.3.12","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.5.10","2.5.11","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.1.0","3.1.1","3.1.2","3.2.0","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.2.6","3.3.0","3.3.1","3.3.2","3.3.3","3.3.4","3.3.5","3.3.6","1.0.0-beta","1.0.0-beta2","1.0.0-rc","1.0.0-rc2","1.0.0-rc3","1.0.0-rc4","2.0.0-beta","2.0.0-beta2","2.0.0-beta3","2.0.0-rc","2.0.0-rc2","2.0.0-rc3","3.0.0-alpha1","3.0.0-alpha2","3.0.0-alpha3","3.0.0-alpha4","3.0.0-alpha5","3.0.0-beta1","3.0.0-beta2","3.0.0-beta3","3.0.0-beta4","3.0.0-beta6","3.0.0-beta7","3.0.0-rc1","3.0.0-rc2","3.0.0-rc3","3.0.0-rc4","3.0.0-rc5","3.3.7"]
npm ERR!     at installTargetsError (/home/admin/.nodes/0.10.17/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR!     at next (/home/admin/.nodes/0.10.17/lib/node_modules/npm/lib/cache.js:698:17)
npm ERR!     at /home/admin/.nodes/0.10.17/lib/node_modules/npm/lib/cache.js:675:5
npm ERR!     at saved (/home/admin/.nodes/0.10.17/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /home/admin/.nodes/0.10.17/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "/home/admin/.nodes/current/bin/node" "/home/admin/.nodes/current/bin/npm" "install" "express"
npm ERR! cwd /home/admin/M101JS/Week 2/hw2/hw2-3/blog
npm ERR! node -v v0.10.17
npm ERR! npm -v 1.3.8
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/admin/M101JS/Week 2/hw2/hw2-3/blog/npm-debug.log
npm ERR! not ok code 0
npmhttpgethttps://registry.npmjs.org/express
npm http GEThttps://registry.npmjs.org/express
npm http 304https://registry.npmjs.org/express
npm错误!错误:找不到兼容版本:express@'>=4.0.0-0
npm错误!有效的安装目标:
npm错误!["0.14.0","0.14.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","2.0.0","2.1.0","2.1.1","2.2.0","2.2.1","2.2.2","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.3.9","2.3.10","2.3.11","2.3.12","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4"“2.5.5.5”、“2.5.5.5.5”、“2.5.5.6”、“2.5.5.9”、“2.5.5.10”、“2.5.5.5”、“2.5.5.5.5.5”、“2.5.5.5.5”、“2.5.5.5.5.5”、“2.5.5.5.5.5.5.5.5”、“2.5.5.5.5 5.5 5 5”、“2.5.5”、“2.5”、“2.5.5”、“2.5”、“2.5.5.5”、“2.5.5.5.5.5.5 5”、“2.5”、“2.5”、“2.5.5”、“2.5.5.5”、“2.5.5.5.5”、“2.5.5.5”、“2.5.5.5”、“2.5”、“2.5.5.5.5.5.5.5.5”、“2.5.5.5.5.“0.0-beta”、“1.0.0-beta2”、“1.0.0-rc”、“1.0.0-rc2”、“1.0.0-rc3”、“1.0.0-rc4”、“2.0-beta”,“2.0.0.0.0-0-0-0-0-0-0-beta3”、“2.0.0-0-rc2”、“2.0.0.0-0-rc3”、“3.0.0.0.0.0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-rc3”、“2.0.0.0-rc3-rc3”、“3.0-0-0-0-rc3”、“3.0-3.0-0-0-0-3”、“3.0-3.0-0-0-0-0-0-3”、“3.0.0.0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-“3.3.7”]
npm ERR!在installTargetsError(/home/admin/.nodes/0.10.17/lib/node\u modules/npm/lib/cache.js:719:10)
npm ERR!在next(/home/admin/.nodes/0.10.17/lib/node_modules/npm/lib/cache.js:698:17)
npm ERR!at/home/admin/.nodes/0.10.17/lib/node_modules/npm/lib/cache.js:675:5
npm ERR!在保存时(/home/admin/.nodes/0.10.17/lib/node_modules/npm/node_modules/npm registry client/lib/get.js:142:7)
npm ERR!at/home/admin/.nodes/0.10.17/lib/node_modules/npm/node_modules/feature fs/polyfills.js:133:7
npm ERR!at Object.oncomplete(fs.js:107:15)
npm ERR!如果您需要帮助,可以在以下位置报告此日志:
npm错误!
npm ERR!或通过电子邮件发送至:
npm错误!
npm ERR!System Linux 3.8.0-29-generic
npm ERR!command“/home/admin/.nodes/current/bin/node”“/home/admin/.nodes/current/bin/npm”“install”“express”
npm ERR!cwd/home/admin/M101JS/Week 2/hw2/hw2-3/blog
npm错误节点-v v0.10.17
npm ERR!npm-v1.3.8
npm错误!
npm ERR!其他日志详细信息可在以下位置找到:
npm ERR!/home/admin/M101JS/Week 2/hw2/hw2-3/blog/npm-debug.log
npm错误!不正常代码0
我对NodeJS和NPM是新手,所以我不理解他们的反应。
有人知道我如何修复它吗?

您想运行最新的节点(当前为0.10.22)。请尝试以下步骤以获得最新版本:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs -y # newer nodejs package includes npm
然后在
npm install express上重试

更新您的npm

npm install -g npm
这是npm早期版本中的一个错误:


更新时可能会收到警告。再运行一次更新,您应该会看到一个干净的npm安装。

虽然@Jim的解决方案运行良好,但如果您觉得需要更新NodeJS,可以通过以下方式进行:


若你们坐在公司网络中,那个么值得将registry指向你们的公司注册中心/工件并尝试一下


npm config set registry

我最近也遇到了这个问题,但不确定如何解决。请尝试将npm更新到最新版本。有点有趣,我想解决安装时遇到的问题forever@0.10.0在Nodejs@0.8.16及NPM@1.1.69,然后我找到了你的评论。将NPM更新到最新版本(@2.8.3)后,错误消失了。
sudo npm cache clean -f
sudo npm install -g n
sudo n stable