npm ERR! Response timeout while trying to fetch http://registry.npmjs.org/@typescript-eslint%2feslint-plugin (over 30000ms)

Viewed 2628

NPM version (npm -v) is 6.14.4

I want to create react application using 'npx create-react-app helloapp',but I got an error saying that it could not fetch the data.

Error is - npm ERR! Response timeout while trying to fetch http://registry.npmjs.org/@typescript-eslint%2feslint-plugin (over 30000ms).

2 Answers

Clean npm cache:

npm cache clean --force

then

npm install -g create-react-app    
npx create-react-app my-app     
cd my-app      
npm start
  1. Go to C:\Program Files\nodejs\node_modules\npm\npmrc

  2. Edit the npmrc file and set:

     timeout:600000
    
     prefer-offline=true.
    
  3. Try again. It will work.

Related