尝试使用yeoman发生器时npm错误

时间:2014-10-07 19:58:35

标签: node.js npm yeoman

你好我试着运行npm install -g哟但是我有错误:

    npm install -g yo
npm http GET https://registry.npmjs.org/yo
npm http 304 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/local/lib/node_modules/npm/lib/cache.js:486:10)
npm ERR!     at next_ (/usr/local/lib/node_modules/npm/lib/cache.js:436:17)
npm ERR!     at next (/usr/local/lib/node_modules/npm/lib/cache.js:413:44)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:406:5
npm ERR!     at saved (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:151:7)
npm ERR!     at Object.oncomplete (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR! 
npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! cwd /home
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.21
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! Error: EACCES, open 'npm-debug.log'
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! 
npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! cwd /home
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.21
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! message EACCES, open 'npm-debug.log'
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/npm-debug.log

我不知道我的npm版本是什么错误1.1.21我的节点版本是v0.6.18 你能给我一些建议,说明配置有什么问题吗?

1 个答案:

答案 0 :(得分:0)

您需要升级Node.js版本和npm。

来自Yeoman website

  

安装先决条件

     

在安装Yeoman之前,您需要以下内容:

     
      
  • Node.js v0.10.x +
  •   
  • npm(与Node捆绑在一起)v1.4.3 +
  •   
  • GIT中
  •