uglify-js节点模块没有用npm安装

时间:2014-04-26 22:18:38

标签: node.js npm uglifyjs

每当我尝试在我的Raspberry Pi上使用npm安装uglify-js时,我都会收到错误消息。我正在尝试安装jade,而uglify是一个依赖项。快速安装也失败了。

对我来说,它看起来像是npm或node.js已经过时了。

npm version = 1.1.4,node.js version = 0.6.19,我正在使用npm的jpmjs.eu注册表镜像。

要安装nodejs和npm,我做了sudo apt-get install nodejs npm.我已经更新了所有内容。有什么问题?

pi@raspberrypi ~ $ npm update -g npm
pi@raspberrypi ~ $ npm install uglify-js
npm http GET http://registry.npmjs.eu/uglify-js
npm http 304 http://registry.npmjs.eu/uglify-js
npm http GET http://registry.npmjs.eu/uglify-to-browserify
npm http GET http://registry.npmjs.eu/async
npm http GET http://registry.npmjs.eu/source-map
npm http GET http://registry.npmjs.eu/optimist
npm http 304 http://registry.npmjs.eu/uglify-to-browserify
npm http 304 http://registry.npmjs.eu/async
npm http 304 http://registry.npmjs.eu/optimist
npm http 304 http://registry.npmjs.eu/source-map
npm ERR! error installing uglify-js@2.4.12

npm ERR! Error: No compatible version found: source-map@'>=0.1.7- <0.2.0-'
npm ERR! Valid install targets:
npm ERR! ["0.0.0","0.1.0","0.1.1","0.1.2","0.1.3"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR!     at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR!     at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR!     at /usr/share/npm/lib/cache.js:408:5
npm ERR!     at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR!     at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/pi/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.10.25+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "uglify-js"
npm ERR! cwd /home/pi
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: source-map@'>=0.1.7- <0.2.0-'
npm ERR! message Valid install targets:
npm ERR! message ["0.0.0","0.1.0","0.1.1","0.1.2","0.1.3"]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/npm-debug.log
npm not ok

1 个答案:

答案 0 :(得分:1)

升级节点安装。 node v0.6.x已经过时了,v0.10.26是当前的稳定版本(截至本文撰写时)。

如果您使用的是Debian,可以从wheezy-backports, jessie, and sid repos获取v0.10.26。

如果您使用的是Ubuntu,则可以使用this repo轻松保持最新状态。

我不确定其他平台的软件包,但如果没有别的,那么nodejs.org上总会有预编译的二进制tarball和源代码(这是一个简单./configure && make && sudo make install)。