1

I'am facing issue when tried running npx create-react-app my-app below are the details,

E:\>npx create-react-app myapp
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND host
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Abhilash\AppData\Roaming\npm-cache\_logs\2020-07-21T11_35_42_783Z-debug.log
Install for [ 'create-react-app@latest' ] failed with code 1

log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'create-react-app@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\Users\\Abhilash\\AppData\\Roaming\\npm-cache\\_npx\\10908',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v14.3.0
4 verbose npm-session 5a581b78d647a254
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for create-react-app@latest request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND host
8 timing stage:rollbackFailedOptional Completed in 1ms
9 timing stage:runTopLevelLifecycles Completed in 2339ms
10 verbose type system
11 verbose stack FetchError: request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND host
11 verbose stack     at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
11 verbose stack     at ClientRequest.emit (events.js:315:20)
11 verbose stack     at Socket.socketErrorListener (_http_client.js:467:9)
11 verbose stack     at Socket.emit (events.js:315:20)
11 verbose stack     at emitErrorNT (internal/streams/destroy.js:100:8)
11 verbose stack     at emitErrorCloseNT (internal/streams/destroy.js:68:3)
11 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
12 verbose cwd E:\
13 verbose Windows_NT 10.0.18363
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app@latest" "--global" "--prefix" "C:\\Users\\Abhilash\\AppData\\Roaming\\npm-cache\\_npx\\10908" "--loglevel" "error" "--json"
15 verbose node v14.3.0
16 verbose npm  v6.14.5
17 error code ENOTFOUND
18 error errno ENOTFOUND
19 error network request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND host
20 error network This is a problem related to network connectivity.
20 error network In most cases you are behind a proxy or have bad network settings.
20 error network
20 error network If you are behind a proxy, please make sure that the
20 error network 'proxy' config is set properly.  See: 'npm help config'
21 verbose exit [ 1, true ]

I can see in the errors are poiting out proxy settings but iam not using any of those and my proxy settings are below, enter image description here

Does anyone encountered this issue?

Abhilash Poojary
  • 127
  • 1
  • 2
  • 11

1 Answers1

1

This worked for me

  1. npm config set registry https://registry.npm.taobao.org
  2. npx create-react-app my-app

Taken from https://www.programmersought.com/article/67016822875/

Dharman
  • 30,962
  • 25
  • 85
  • 135