npm install stuck

If you get stuck during npm install and do not move, you can try the following methods.

  • Set up the registration center and use the Taobao registration center.
    • This mainly solves the download failure caused by network problems. npm config set registry https://registry.npmmirror.comAfter setting, you npm config getcan use it to view the setting results. According to the notification from the official website , the Taobao mirror has been replaced with a mirror.npmjs.org
  • Delete the node_modules folder and execute npm install
    • We all know that the packages installed by npm install are all in node_modules. After deleting node_modules, it can prevent the secondary download failure caused by a package download failure.
  • delete package-lock.jsonfile
    • package-lock.jsonThe file will lock the version, and sometimes the download fails because the local nodejs version does not match the version in the locked file, and the node_modules folder must also be deleted.
  • node-sass version does not match local nodejs version

Guess you like

Origin blog.csdn.net/wangjun5159/article/details/130237280