Npm installation error Cannot find module 'read-package-json.js'

enter image description here

when I install npm, as shown above, the message messge show: Error: cannot find module '/private/var/folders/dm/bzjdbz_s1z1bby3p087g0jr00000gn/T/npm.922/package/bin/read-package-json.js'

see pic.any tips for more details? thanks

+5
source share
2 answers

Here's how I solved it:

echo prefix=~/.npm-packages >> ~/.npmrc wget https://registry.npmjs.org/npm/-/npm-5.5.1.tgz tar xf npm-5.5.1.tgz cd package ./npm-cli.js install npm -g 
+2
source

You can follow these steps:

 brew uninstall --force node brew update brew upgrade brew cleanup brew install node sudo chown -R $(whoami) /usr/local #may not work brew link --overwrite node sudo brew postinstall node #may not work 

You may have problems with sudo, but don't worry that it should work without it :)

0
source

Source: https://habr.com/ru/post/1271892/


All Articles