-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] Failed to install any package with ERROR Code"npm ERR! Cannot read property 'insert' of undefined" #4876
Comments
OK it has been fixed. |
run follow for china
|
when i update node version to v18.12.1 and npm still is v8.5.1, problem solved |
i got this error when set registry to http://registry.npmmirror.com so: npm cache clear --force
npm config set registry https://registry.npmmirror.com is the best answer |
npm ERR! Cannot read property 'insert' of undefined npm ERR! A complete log of this run can be found in: why am i getting this |
I got this error after clearing cache trying to fix the stuck @itchenfei's response helped. Changing the URL scheme from http to https did the trick. |
I am using Ubuntu 22, I have used these versions using these commands so it worked for me: sudo apt install -y curl node -v Should output: v18.12.1sudo npm install -g npm@8.5.1 |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Why I don't use the latest version of npm:I even can't update npm by using "sudo npm i -g npm".
The environment information:
node version: v12.22.9
npm version: v8.5.1
WSL version:
Build: 22598
Release: Ubuntu 22.04 LTS
Kernel: Linux 5.10.102.1-microsoft-standard-WSL2
This problem also exists in these websites:
https://serveanswer.com/questions/npm-install-error-npm-err-cannot-read-property-insert-of-undefined
https://stackoverflow.com/questions/72004247/npm-install-error-npm-err-cannot-read-property-insert-of-undefined/72183748#72183748
They use the same version of node and npm as I , but I can't know if they are also using WSL too.
Expected Behavior
Install normally.
Steps To Reproduce
sudo npm i -g npm
Actually , whatever package I install , it fails with the same ERROR Code.
Environment
The text was updated successfully, but these errors were encountered: