-4

I just updated my npm and got rid of some useless packages, but for some reason, I still am running into some weirdness when trying to run this command

kalebamarante$ npm init create-react-app kalebcryptoexchange-app
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/create-create-react-app - Not found
npm ERR! 404 
npm ERR! 404  'create-create-react-app@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kalebamarante/.npm/_logs/2021-03-09T00_18_58_939Z-debug.log
KALEBS-MacBook-Pro:~ kalebamarante$ npx create-react-app kalebcryptoexchange-app

You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.3).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

npm ERR! code 1
npm ERR! path /Users/kalebamarante
npm ERR! command failed
npm ERR! command sh -c create-react-app kalebcryptoexchange-app

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kalebamarante/.npm/_logs/2021-03-09T00_20_01_995Z-debug.log
KALEBS-MacBook-Pro:~ kalebamarante$ sh -c create-react-app kalebcryptoexchange-app
kalebcryptoexchange-app: create-react-app: command not found

2 Answers2

1

you should try npx instead of npm init. npx create-react-app kalebcryptoexchange-app.

Muhammad Taseen
  • 519
  • 7
  • 22
1

You should use npx instead of npm.

npx create-react-app your-app

Now why is that?

When you are using npm command it will get the node packages for you. i.e. You may have installed the package called 'create-react-app' globally using npm. Now to execute that package you have to use npx command.

Your error log shows this line,

npm ERR! 404  'create-create-react-app@latest' is not in the npm registry.

because you are trying to fetch a package instead of creating it using create-react-app.

In short, npm downloads the packages, npx execute a package.

shahriar hasan
  • 113
  • 1
  • 3
  • 10