Ubuntu – npm update check failed

17.04npmsoftware installation

i was actually trying to install nodejs along with npm on my ubuntu 17.04. i downloaded linux version from nodejs.org and created soft link for node and nodejs. upon checking the version of nodejs it shows the version i installed and i'm fine with it.

now i tried to do same for npm. i tried to create soft link for npm.

 sudo ln -sf /mnt/7A46BE1454633621/softwares/programming/frontend/nodejs/lib/node_modules/npm/bin/npm 

i don't know the link i created is correct or not. but upon running npm -v command i see the version 5.0.3 which is what i am trying to install. the version is shown but right below it i see something like this.

npm update check failed                 │
│           Try running with sudo or get access           │
│          to the local update config store via           │
│ sudo chown -R $USER:$(id -gn $USER) /home/sagar/.config 

Best Answer

My npm version is 5.0.3 and I have the same problem when I use any npm command:

npm error message

The command is working fine but this code keeps showing up for no apparent reason. I've updated from 5.0.3 to 5.2.0 with these commands:

sudo chown -R $USER:$(id -gn $USER) /home/sagar/.config

npm install -g npm or npm i -g npm.

Now npm is working fine.

Related Question