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 
  • Did you sudo chown -R $USER:$(id -gn $USER) /home/sagar/.config as advised? – George Udosen Jun 15 '17 at 4:08
  • If you’re using Docker, double check if the filesystem is read-only. It must be writable. – Константин Ван Aug 10 '19 at 8:46

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.

  • Worked for me. Although, I had to update npm as root with sudo npm i -g npm. Updated npm to 6.0.1 – Denialos May 20 '18 at 12:35

Exact same issue for me, but doesn't seem related to the version (I'm using npm 5.5.1). Fixing the rights on ~/.config made the trick for me:

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

I guess this is related to some owner issue with ~/.config/configstore/update-notifier-npm.json.


Please, do not use the provided chown command in the error message. The path ~/.config is used by many applications and is a standard path for storing config information. It is not recommended to change the group rights there. Better only change the required path like:

sudo chown -R $USER ~/.config/configstore

Special case: Docker

A common case to get this error is using something like Docker (especially by mounting your own home). Consider setting the environment variables like NPM_CONFIG_CACHE and XDG_CONFIG_HOME. The first one sets your cache path and the last one is setting your configstore path. I would not use the .config folder in the home directory to avoid problems with file ownership. But using cache helps services like NPM to save bandwith. Try to avoid excessive downloads on every build and use something like this (but check that the target like /tmp has sufficient disk space):

test -d /tmp/$USER/cache || mkdir -p /tmp/$USER/cache
docker run \
  -v /tmp/$USER:/tmp/$USER \
  -e "NPM_CONFIG_CACHE=/tmp/$USER/cache/npm" \
  -e "XDG_CONFIG_HOME=/tmp/$USER/cache/" \
  • Thanks this helped me a lot when using npm in a Lambda environment. Setting the NPM_CONFIG_CACHE and XDG_CONFIG_HOME variables fixed my problem. – wlarcheveque Nov 13 '20 at 18:19
  • Thanks for the docker case, it saved me some time ! – Kevin Thomas Jan 19 at 13:42

I had change the owner of




to $USER:$USER .

My guess is that running npm with sudo created that file. On my system at least we find this:

$ env | grep  -e HOME= -e "^USER="

$ sudo env | grep  -e HOME= -e "^USER="

So if sudo npm is coded to create ~/configstore/update-notifier-npm.json it's going to do it the ordinary user's home directory. That creates a problem when later running npm without sudo which also wants to read and maybe write ~/configstore/update-notifier-npm.json. For some reason the permissions are 600 on both.

Be cautious when chown and chmod -ing everything under ~/.config, there might be something sensitive there.


Well, first thing we can do to solve this issues is

  1. Make sure you have ticked an option in folder setting to see hidden files.
  2. Right click on .config file and select properties and then click on permissions tab.
  3. In folder permissions and file permissions for group | owner | others tick the read, write and execute options.
  4. AT the bottom click on Apply permissions to enclosed files.
  5. Now try to rerun the same npm commands where you were seeing those messages and now it should be gone forever.

If this helped you know what to do.

Note: Same procedure can also be applied for configstore alone within .config folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.