2013-07-26 44 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啓動一般步驟