Skip to content
Advertisement

npm related tasks are throwing errors during installations

I’ve been having this problem recently that nothing related to npm is working for me except npm start.

npm install is giving this error:

JavaScript

npx create-react-app ./ is giving this error:

JavaScript

EDIT: So I tried using Yarn for my installs but got this error:

JavaScript

How do I fix this?

Edit: My version of npm is 6.14.8

Advertisement

Answer

First of all you need to make sure that your node and npm versions are up to date. if not please upgrade your node and npm packages to latest versions.

JavaScript

Delete your node_modules folder, package-lock.json and yarn file (if you have).

Force clean the entire NPM cache by using following comand.

JavaScript

Re-Install all the dependencies.

JavaScript

If above step didn’t resolve your problem, try to uninstall yarn globally by delete the Yarn folder from global folder and then run.

JavaScript
Advertisement