Jesse Lawson

Software engineering, artificial intelligence, writing, and open-source tools

Jan 1, 0001 - NodeJS Tutorials

[Solved] NPM Error: No compatible version found

If you’re trying to install a package via npm and you’re getting an Error that says “no compatible version found,” then chances are you need to update your NodeJS package.

For example, when trying to install Yeoman, you might get this:

npm ERR! command "node" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /var/www/
npm ERR! node -v v0.6.12
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!

Obviously you can see that node is out of date. To fix this, run the following commands:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs -y 

Wait for a moment while the installer updates node for you, and then go ahead and try to reinstall your package.