Domanda

I am trying to install yeoman but I am getting the following error messages:

I did install node.js and npm (latest version),now I am doing this

npm install -g yo grunt-cli bower

and 

npm install -g yo 

but I get the following error messages

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

What is wrong? Is it something with my linux system or with npm or with node.js? I need yeoman up and running soon but I am stuck.

È stato utile?

Soluzione

You might try reading the error message:

npm ERR! Perhaps not compatible with your version of node?

Yeoman requires Node >=0.8, but you have Node 0.6:

npm ERR! node -v v0.6.19

Upgrading to latest stable Node should do it.

sudo apt-get install node -y

Altri suggerimenti

I am using Ubuntu 12.10.

I had the same issue.

I am going to describe my exact fixes for

npm install -g yo
  1. Yeoman requires node version >= 0.8
  2. Because of permissions, I needed to use sudo npm install -g yo

The steps are:

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 is to update the node to the latest version

add-apt-repository is needed for a better repository to update the nodejs

python-software-properties and software-properties-common are for add-apt-repository

For references:

See https://stackoverflow.com/a/16032073/80353 which explains why you need to install either the python or the software to run add-apt-repository

See https://stackoverflow.com/a/16303380/80353 which inspires the general steps

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top