10

Whenever I try to run npx create-react-app my-app, it shows the error:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types/eslint/-/eslint-8.4.4.tgz - Not found
npm ERR! 404 
npm ERR! 404  '@types/eslint@http://registry.npmjs.org/@types/eslint/-/eslint-8.4.4.tgz' is not in this registry.

When I try like eslint-8.4.0.tgz I can download it but 8.4.4 just doesn't exist.

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Manh Huynh Duc
  • 109
  • 1
  • 5
  • There is currently an issue with NPM as shown here: https://status.npmjs.org/incidents/6wr25yb0b2dd Best to go take a break and wait it out for now, or struggle through hurdles to change dependency versions, but it sounds like a nightmare since these are also dependencies of dependencies and you're using `npx` rather than a pre-existing project. You may be able to try and explicitly install `v8.4.3` in a project that already exists instead before running `npm install` (dependencies may honor it), but in your case you're using a global generator, so this isn't as easy of an option. – CTS_AE Jun 30 '22 at 20:55
  • @CTS_AE yeah seems like the only thing to do is wait it out - im trying to follow tutorials as i am learning react in spare time and i don't think i can learn CRA environment without using cra! I have no idea how to downgrade dependencies to stable versions either despite googling around. – PeaceLoveFamily Jun 30 '22 at 21:31

2 Answers2

13

There is an issue with v.8.4.4 on the NPM

Change your package.json and use 8.4.3 instead!

Pin it in "resolutions" for yarn

  "resolutions": {
    "@types/eslint": "8.4.3"
  }

or "overrides" for npm

  "overrides": {
    "@types/eslint": "8.4.3"
  }

more info about overriding values in NPM: How do I override nested NPM dependency versions?

more about issue (check it here):

something went wrong

Pavel Kovalev
  • 7,521
  • 5
  • 45
  • 67
  • Hey apologies if this is a silly question, i'm new to this - but how do i change my package.json when i am getting aborted when trying to `npx create-react-app my-app` ? should i npm init first? sorry if thats all a silly question! – PeaceLoveFamily Jun 30 '22 at 21:04
  • @LouisEguchi no worries, I’m not a huge react expert (I’m using vue) but as far as I understand your command generates a set of files and one of them is package.json and this is your guy – Pavel Kovalev Jun 30 '22 at 21:11
  • Be sure to update your npm to latest. The 'overrides' directive is only available in v8+. Otherwise, this solution worked for me – Kremnari Jun 30 '22 at 21:17
  • @PavelKovalev no worries - ahh doesnt seem to be possible as the `npx create-react-app` aborts and deletes all files before i can change the package.json : ( – PeaceLoveFamily Jun 30 '22 at 21:26
  • 1
    i found the answer in this works really well - either force it to use an older version or clone an older version from git - this works for me because i just need to carry on following tutorials but cannot use `npx create-react-app my-app` After a lot of googling it just seems a dependency is down. and the best answer i found is here in this thread essentially wait it out - download a manual create-react-app template or force to use older version https://stackoverflow.com/questions/72821556/types-eslint-v8-4-4-missing-from-npm-registry – PeaceLoveFamily Jun 30 '22 at 22:01
  • you can do npm init. This will create in your working folder a package.json. Here you can modify. -------- After this npx create-react-app myApp ..... It will create another folder myApp with your react project. Here inside there will be another package.json – nicolass Jul 01 '22 at 11:28
1

It is not a problem of React, but a problem of a package @types/eslint. Seems like the bad version of the package was upgraded and it's not downloadable. To solve the issue, you may want to create a react app, without using create-react-app. To do this, try to use the following tutorial

Or you can wait until the package is fixed.

Farid Shabanov
  • 206
  • 3
  • 11
  • The issue is with webpack, which has eslint as a dependency. Manual creating a React app therefore won't work either! It will fail when you try to add webpack as a dev dependency. – Roo Jun 30 '22 at 20:56
  • 1
    @Roo you're correct, I missed the webpack part. You may consider the answer of Pavel Kovalev and set the version of @types/eslint in your package.json – Farid Shabanov Jun 30 '22 at 20:59