Last updated: Apr 4, 2024
Reading time·3 min
The error "npm update check failed" occurs when npm tries to check for an update
but fails due to permission issues or because of a glitched configstore
directory.
To solve the error, delete the configstore
directory and update your version
of npm
.
Here is the complete error message.
┌───────────────────────────────────────────────────────────────────┐ │ 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) /Users/bobbyhadz/.config | └───────────────────────────────────────────────────────────────────┘
If you are on macOS or Linux, try changing the ownership of the .config
directory by running the following command.
username
placeholder with your actual username.sudo chown -R $USER:$(id -gn $USER) /home/{username}/.config
If you got the error when using npm
on a remote server (e.g. an AWS EC2
instance), try issuing the following command.
sudo chown -R $USER:$(id -gn $USER) ~/.config
Try to issue an npm
command and see if you get the error message afterward.
npm --version
configstore
directoryThe configstore
directory often glitches due to permission issues.
If you delete the directory, it will get re-generated the next time you run an
npm
command, e.g. npm --version
or npm start
.
configstore
on WindowsOn Windows, the configstore
directory is located at:
C:\Users\<username>\.config\configstore
Make sure to replace the <username>
placeholder with your actual username.
Go to the C:\Users\<username>\.config
folder and delete the configstore
folder.
Alternatively, you can delete the folder with a command.
rd /s /q "C:\Users\<username>\.config\configstore"
Make sure to replace <username>
with your actual username.
Try to issue an npm
command after deleting the configstore
folder.
configstore
on macOS or LinuxOn macOS and Linux, the configstore
folder is located at:
~/.config/configstore
or /Users/<username>/.config/configstore
For example, if your .config
directory is located at ~/.config/configstore/
,
you can delete it with the following command.
rm -rf ~/.config/configstore
npm
If the error persists, try updating your version of npm
.
On Windows, issue the following command.
npm install -g npm@latest
On macOS and Linux, issue the following command.
sudo npm install -g npm@latest
Try to issue an npm
command, e.g. npm --version
to see if the error
persists.
If you still get the error, disable the notifier by running the following command.
npm config set update-notifier false
The command disables the notifier globally, in your npm config.
You can view the value of the update-notifier
key with the following command.
npm config get update-notifier
If you need to delete the update-notifier
key, use the following command.
npm config delete update-notifier
If the issue persists, reinstall Node.js and npm and install the long-term supported (LTS) version.
You can download the LTS version from the official nodejs.org site.
Alternatively, you can use a Node package manager like nvm
: