简体   繁体   English

uglify-js节点模块未与npm一起安装

[英]uglify-js node module not installing with npm

Whenever I try to install uglify-js with npm on my Raspberry Pi, I get an error. 每当我尝试在Raspberry Pi上使用npm安装uglify-js时,都会出现错误。 I am trying to install jade, and uglify is a dependency. 我正在尝试安装玉器,而uglify是一个依赖项。 Express install fails as well. 快速安装也会失败。

To me, it looks like either npm or node.js is outdated. 在我看来,npm或node.js都已过时。

npm version = 1.1.4, node.js version = 0.6.19, I am using the npmjs.eu registry mirror for npm. npm版本= 1.1.4,node.js版本= 0.6.19,我正在使用npmjs.eu注册表镜像。

To install nodejs and npm, I did sudo apt-get install nodejs npm. 要安装nodejs和npm,我做了sudo apt-get install nodejs npm. I have updated everything I could. 我已经尽力了。 What is the problem? 问题是什么?

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

Upgrade your installation of node. 升级节点的安装。 node v0.6.x is quite old and v0.10.26 is the current stable version (as of this writing). 节点v0.6.x相当旧,而v0.10.26是当前的稳定版本(截至撰写本文时)。

If you're on Debian, v0.10.26 is available from the wheezy-backports, jessie, and sid repos. 如果您使用的是Debian,可从wheezy-backports,jessie和sid仓库中获取v0.10.26。

If you're on Ubuntu, you can use this repo to easily stay up to date. 如果您使用的是Ubuntu,则可以使用此存储库轻松保持最新状态。

I'm not sure about packages for other platforms, but if nothing else there are always pre-compiled binary tarballs and source code (which is an easy ./configure && make && sudo make install ) available on nodejs.org . 我不确定其他平台的软件包,但是如果没有其他问题,在nodejs.org上总是会提供预编译的二进制tarball和源代码(这是一个简单的./configure && make && sudo make install )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM