简体   繁体   中英

I am trying to install node locally following error occurs. I tried reinstalling node several times but still it shows error

I get this error when I try to install node

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2020-08-29T13_30_35_085Z-debug.log
  1. try this first before installing node.

     sudo npm cache verify sudo npm cache clean --force
  2. After installing verify your installation:

    node --version

several things you can try are following

sudo npm cache clean --force

trying changing ownership of npm and try npm latest

sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib
sudo chown -R $(whoami) /usr/local/bin
npm install -g npm@latest

give it a try by clearing up the proxy, maybe you're behind proxy

npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.npmjs.org/

Lately i would like to recommend you to use the NVM package . it is not the solution to your answer directly but its a great way to manage and have different node/npm environments https://davidwalsh.name/nvm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM