nodejs npm install error帮助,急!
发布于 11 年前 作者 chenyi14500 11700 次浏览 最后一次编辑是 8 年前

Hi 小弟正在学习node.js 照着node.js 开发指南这本书在学,express -t ejs microblog 之后npm install 出现一下error log(照书上讲的执行本来应该没问题的,但失败了, 我的平台是linux(ubuntu)) : npm ERR! error installing uglify-js@2.2.5 npm ERR! error installing transformers@2.0.1 npm ERR! error installing jade@0.30.0 npm http 304 https://registry.npmjs.org/optimist

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/yichen/Application/NodeJs/microblog/npm-debug.log npm npm ERR! npm ERR! System Linux 3.2.0-40-generic-pae npm ERR! command “node” “/usr/bin/npm” "install" npm ERR! cwd /home/yichen/Application/NodeJs/microblog npm ERR! node -v v0.6.12 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 http 304 https://registry.npmjs.org/minimatch npm http GET https://registry.npmjs.org/minimatch/-/minimatch-0.2.12.tgz npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/yichen/Application/NodeJs/microblog/npm-debug.log npm not ok

3 回复

Node 0.6, 还真是好久不见了

那本书很远古了吧…express 的版本应该还是2.x的吧…你下载的express 有没有设定为2.x?

Error: No compatible version found: source-map@'>=0.1.7- <0.2.0-'

大概意思是在所依赖的模块 source-map 其版本范围 >=0.1.7 && <0.2.0 中没有找到合适的当前系统环境的版本

你系统中的 Node 是 0.6.x 的,而 source-map 最新版本要求必须 >= 0.8.x ,安装新版本的 Node 应该就没问题了。

回到顶部