0

I'm trying to install Yeoman so I can install AngularJS, but I run into problems regarding the version of npm. Here's the output when I run npm install -g yo:

npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/home/marieficid/.node/bin/yo -> /home/marieficid/.node/lib/node_modules/yo/lib/cli.js

> yo@1.6.0 postinstall /home/marieficid/.node/lib/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✖ Node.js version

Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org

✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm

✔ NODE_PATH matches the npm root

Found potential issues on your machine :(
/home/marieficid/.node/lib
└── yo@1.6.0 

And here's the output when I run npm install -g npm@latest (my current version is 3.7.3):

/home/marieficid/.node/bin/npm -> /home/marieficid/.node/lib/node_modules/npm/bin/npm-cli.js
/home/marieficid/.node/lib
└── npm@3.7.3 

Anyone knows how to fix this?

EDIT: running sudo npm --version returns 2.14.12 instead of 3.7.3.

1 Answers1

0

You most likely have a .npmrc file in your home folder that contains a prefix variable.

If this is the case you will have to update your $PATH variable adding the new bin path, in your case $HOME/.node/bin/, also ensure it is after which ever path npm is currently in, this you can find out by using which npm. To set your path variable: What is the PATH environment variable and how do I add to it? and https://help.ubuntu.com/community/EnvironmentVariables

Jkamzi
  • 1