npm error: line 1: rimraf: command not found

I pulled a project today and kept getting errors when running npm i.

 I suspect it may be an issue with the npm version. I used the following command and then re-npm i

npm config set legacy-peer-deps true
npm install

After installing node_modules, npm run start started the project, but another error was reported.

Finally, the problem was solved with the following naming 

rm -rf node_modules/ && rm -rf package-lock.json && npm i

Guess you like

Origin blog.csdn.net/melissaomy/article/details/128702132