我正在尝试安装yeoman但是我收到以下错误消息:
我确实安装了node.js和npm(最新版本),现在我正在做这个
npm install -g yo grunt-cli bower
and
npm install -g yo
但是我收到以下错误消息
npm http GET https://registry.npmjs.org/yo
npm http 200 https://registry.npmjs.org/yo
npm ERR! Error: No compatible version found: yo
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
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/siddhartha/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /home/siddhartha
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: yo
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/siddhartha/npm-debug.log
npm not ok
有什么问题?它是我的linux系统或npm或node.js的东西?我很快就需要和你一起跑,但我被卡住了。
答案 0 :(得分:5)
您可以尝试阅读错误消息:
npm ERR!可能与您的节点版本不兼容?
Yeoman要求Node&gt; = 0.8,但你有Node 0.6:
npm ERR! node -v v0.6.19
升级到最新的稳定节点应该这样做。
sudo apt-get install node -y
答案 1 :(得分:5)
我正在使用Ubuntu 12.10。
我有同样的问题。
我将描述我对
的确切修复npm install -g yo
sudo npm install -g yo
步骤如下:
sudo apt-get install python-software-properties -y
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update -y
sudo apt-get install nodejs -y
sudo npm install -g yo
install nodejs
是将节点更新为最新版本
add-apt-repository
需要 nodejs
才能获得更好的存储库
python-software-properties
和software-properties-common
适用于add-apt-repository
供参考:
请参阅https://stackoverflow.com/a/16032073/80353,其中说明了为什么需要安装python或软件才能运行add-apt-repository
参见https://stackoverflow.com/a/16303380/80353,它激发了一般步骤