2013-07-26 36 views
2

我试图安装自耕农,但我收到以下错误消息:问题安装自耕农

我没有安装的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

错误消息说明了有关您的节点版本的信息。你有什么版本? 'node -v' – Third

+0

等待我刚刚安装了node.js,但是当我的节点没有安装消息节点时 –

+0

我应该重新启动系统吗? –

回答

5

你可以尝试读取错误消息:

NPM ERR!也许与您的节点版本不兼容?

约曼要求节点> = 0.8,但你必须节点0.6:

NPM ERR! node -v v0.6.19

升级到最新的稳定节点应该这样做。

sudo apt-get install node -y 
5

我使用的是Ubuntu 12.10。

我有同样的问题。

我要描述我确切的修复

npm install -g yo 
  1. 约曼要求节点版本> = 0.8
  2. 由于权限的,我需要使用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-propertiessoftware-properties-commonadd-apt-repository

为引用:

https://stackoverflow.com/a/16032073/80353哪些解释了为什么您需要安装python或运行软件add-apt-repository

请参阅https://stackoverflow.com/a/16303380/80353启动一般步骤