Home > Back-end >  npm ERR! code ENOTFOUND How Can I fix it?
npm ERR! code ENOTFOUND How Can I fix it?

Time:12-06

I met this problem when I use react.

In terminal

npx create-react-app myproject

Error message

npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry/,npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND proxy.company.com
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!     /Users/****/.npm/_logs/2022-12-01T16_39_36_991Z-debug-0.log

log file

26 verbose logfile logs-max:10 dir:/Users/****/.npm/_logs
27 verbose logfile /Users/****/.npm/_logs/2022-12-01T16_39_36_991Z-debug-0.log
28 timing npm:load:logFile Completed in 2ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 16ms
32 silly logfile start cleaning logs, removing 5 files
33 timing arborist:ctor Completed in 1ms
34 timing arborist:ctor Completed in 0ms
35 silly logfile done cleaning log files
36 timing command:exec Completed in 70053ms
37 verbose type system
38 verbose stack FetchError: request to https://registry/,npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND proxy.company.com
38 verbose stack     at ClientRequest.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
38 verbose stack     at ClientRequest.emit (node:events:513:28)
38 verbose stack     at one rror (/opt/homebrew/lib/node_modules/npm/node_modules/agent-base/dist/src/index.js:117:21)
38 verbose stack     at callbackError (/opt/homebrew/lib/node_modules/npm/node_modules/agent-base/dist/src/index.js:136:17)

Already I uninstall node, npm and reinstall it. But it isn't success create-react-app.

My node version : 19.2.0 My npm version : 8.19.3

What happened in my computer ..

  • Related