简体   繁体   中英

How to solve the error that occurs when npm error

如何摆脱 npm 上的错误

I am using npm version 8.18.0 and node version 16.17.0. When I want to run code to display in the browser an error occurs.

This happened to me recently. I found that this may be some third party dependencies of npm install, which need to be compiled on your machine (node-sass needs to be compiled with c++ before it can be used), or there may be problems in the download or compilation process.

  1. Run rm -rf./node_modules to delete node_modules folder

  2. Run npm cache clean --force to clean npm cache file

  3. Then run npm install to reinstall node modules or node-sass with npm install

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