1

I have tried clearing cache but its not solving my problem. Its working until few hours back . after that i have used npm run eject on one of my other project . After that iam getting this error. I will attach a error file along with log .Can anyone help me with this?

Error


Creating a new React app in F:\React Learning\meals\meal-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/react failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
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\pcmaster\AppData\Roaming\npm-cache\_logs\2020-06-06T14_53_15_643Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting meal-app/ from F:\React Learning\meals
Done.

F:\React Learning\meals>

Generated Logfile

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   '--save',
1 verbose cli   '--save-exact',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   'react',
1 verbose cli   'react-dom',
1 verbose cli   'react-scripts',
1 verbose cli   'cra-template' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session bb041aca5c7d9fbf
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for react@latest request to https://registry.npmjs.org/react failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
8 silly fetchPackageMetaData error for react-dom@latest request to https://registry.npmjs.org/react-dom failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
9 silly fetchPackageMetaData error for react-scripts@latest request to https://registry.npmjs.org/react-scripts failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
10 silly fetchPackageMetaData error for cra-template@latest request to https://registry.npmjs.org/cra-template failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
11 timing stage:rollbackFailedOptional Completed in 3ms
12 timing stage:runTopLevelLifecycles Completed in 363ms
13 verbose type system
14 verbose stack FetchError: request to https://registry.npmjs.org/react failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
14 verbose stack     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
14 verbose stack     at ClientRequest.emit (events.js:198:13)
14 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:392:9)
14 verbose stack     at TLSSocket.emit (events.js:198:13)
14 verbose stack     at emitErrorNT (internal/streams/destroy.js:91:8)
14 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
14 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
15 verbose cwd F:\React Learning\meals\meal-app
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts" "cra-template"
18 verbose node v10.16.3
19 verbose npm  v6.9.0
20 error code ENOTFOUND
21 error errno ENOTFOUND
22 error network request to https://registry.npmjs.org/react failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
23 error network This is a problem related to network connectivity.
23 error network In most cases you are behind a proxy or have bad network settings.
23 error network
23 error network If you are behind a proxy, please make sure that the
23 error network 'proxy' config is set properly.  See: 'npm help config'
24 verbose exit [ 1, true ]

Iam New to react. i have created a react many react app using the same command . But dont know why its not working this time. I have a updated nodejs.

7
  • What do you get when trying to open "registry.npmjs.org/react" on your web browser? Commented Jun 6, 2020 at 15:16
  • Are you connected to internet? Commented Jun 6, 2020 at 15:18
  • are you behind a proxy? Commented Jun 6, 2020 at 15:19
  • What steps did you follow to create new react project? You should not have create-react-app globally installed. Check stackoverflow.com/a/62122386/2873538 for steps. Commented Jun 6, 2020 at 15:19
  • 1
    @AjeetShah Thank you so much. It resolved my issue. Commented Jun 6, 2020 at 16:20

1 Answer 1

1

step 1 ) Clearing Cache using

npm cache clean --force

step 2) Run Command :

npx create-react-app my-app

for npm 5.2+ or higher.

The exact reason for the Error is unknown. But these 2 steps worked for me.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.