'An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed \"404 Not Found\"

When I try to create a new react app with create-react-app, I got the following:

» npx create-react-app my-order

Creating a new React app in /Users/ian/myproject/my-order.

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

yarn add v1.19.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/ian/myproject/my-order/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts --cwd /Users/ian/myproject/my-order has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.

And my local environment information is like this:

» npx create-react-app --info

Environment Info:

  System:
    OS: macOS 10.14.6
    CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  Binaries:
    Node: 11.1.0 - /usr/local/bin/node
    Yarn: 1.19.0 - ~/.yarn/bin/yarn
    npm: 6.7.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 80.0.3987.100
    Firefox: 72.0.2
    Safari: 12.1.2
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: 2.1.1

Anyone have any idea what's going on here?



Solution 1:[1]

Sometimes there is a problem accessing npmjs.com and installing scoped packages. Try to check https://status.npmjs.org/

Solution 2:[2]

Try this in your command: - yarn cache clean - yarn and it will probably work...

Solution 3:[3]

If you use NVM, you might have this problem occur if you switched away from your primary nodejs version that you first had installed, so just change back if you can: nvm use <original node installation's version>

But, if that doesn't work for you, then in your shoes I'd try reinstalling node directly from the website if I can't just use a non-NVM installation: https://nodejs.org/en/

For some people it seems they have an EACCESS error, and that might be fixed by changing their registry from http to https: npm install --registry=https://registry.npmjs.org/

A similar problem: Cannot run npm install from nvm, but working well using source from https://nodejs.org/en/download/

Solution 4:[4]

Try with yarn install --registry=https://registry.yarnpkg.com/. Hope it works!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmytro Cheglakov
Solution 2 Serigne Mbacke KA
Solution 3 slay
Solution 4 Sourav Purkait