Some common solutions to NPM errors

1. npm WARN Local package.json exists, but node_modules missing, did you mean to install?

Solutions:

Enter NPM install or CNPM install to start again

NPM run dev starts successfully

This is probably not a problem with NPM. There is likely additional logging output above.

Sometimes NPM error will only have this line, so this time there is a large possibility that the error is caused by the installation package, so we just need to reinstall the package before starting.

  • To NPM install

  • NPM again run dev

If the package does not work again, there will be errors, then delete the previous installation of the package, clear the cache, reinstall.

  • Rm -rf node_modules or del node_modules
  • rm package-lock.json
  • npm cache clear –force
  • npm install
  • npm run dev