Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C:\Users\yaman>npm -v
6.14.10

C:\Users\yaman>npx create-react-app my-app
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://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!     C:\Users\yaman\AppData\Roaming\npm-cache\_logs\2021-01-19T12_09_35_758Z-debug.log
Install for [ 'create-react-app@latest' ] failed with code 1


What I have tried:

i am new so i don't know how to solve. Thankyou and pls help me to learn react.
Posted
Updated 17-Jul-23 0:28am
Comments
Richard MacCutchan 19-Jan-21 7:49am    
Read the messages and the log file, as instructed above.
Member 15050147 19-Jan-21 11:18am    
i read messages but i dont understand this log file
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 '--https-proxy=http://proxy.company.com:8080',
1 verbose cli '-g',
1 verbose cli 'install',
1 verbose cli 'karma'
1 verbose cli ]
2 info using npm@6.14.10
3 info using node@v14.15.4
4 verbose npm-session 613c09df97c3df0f
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for karma@latest request to http://registry.npmjs.org/karma failed, reason: getaddrinfo ENOTFOUND proxy.company.com
8 timing stage:rollbackFailedOptional Completed in 9ms
9 timing stage:runTopLevelLifecycles Completed in 193ms
10 verbose type system
11 verbose stack FetchError: request to http://registry.npmjs.org/karma failed, reason: getaddrinfo ENOTFOUND proxy.company.com
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:469:9)
11 verbose stack at Socket.emit (events.js:315:20)
11 verbose stack at emitErrorNT (internal/streams/destroy.js:106:8)
11 verbose stack at emitErrorCloseNT (internal/streams/destroy.js:74:3)
11 verbose stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
12 verbose cwd C:\Users\yaman
13 verbose Windows_NT 10.0.19041
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "--https-proxy=http://proxy.company.com:8080" "-g" "install" "karma"
15 verbose node v14.15.4
16 verbose npm v6.14.10
17 error code ENOTFOUND
18 error errno ENOTFOUND
19 error network request to http://registry.npmjs.org/karma failed, reason: getaddrinfo ENOTFOUND proxy.company.com
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 ]
Richard MacCutchan 19-Jan-21 11:40am    
7 silly fetchPackageMetaData error for karma@latest request to http://registry.npmjs.org/karma failed, reason: getaddrinfo ENOTFOUND proxy.company.com

Your network settings are preventing npm from accessing the internet. This is not something anyone here can fix for you.

npm ERR! network request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND proxy.company.com

You seem to be behind an incorrect proxy for npm download.

You need to configure the proxy as shared here: Using npm behind a corporate proxy - Wil Boayue[^]


BTW, before above, in case you have not tried, give this a shot:
npm install -g yarn

yarn global add create-react-app

create-react-app my-app

Hope this helps!
 
Share this answer
 
Comments
Member 15050147 19-Jan-21 11:27am    
sandeep solution not working
sudo chown -R $USER /usr/local/lib/node_modules

Try the above cmd before you installing yarn
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900