How to solve the error that occurs when npm error

Viewed 62

How to get rid of errors on 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.

1 Answers

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

Related