Amit Kumar
Amit Kumar

Reputation: 645

Couldn't find package "react" on the "npm" registry when creating a package

I am trying to create a new react project and used below command

npx create-react-app login

and installation fails, saying "Couldn't find package "react" on the "npm" registry".

Message:

Creating a new React app in C:\Amit\Code\Experiment\TestConsoleApp\login.

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

yarn add v1.7.0
[1/4] Resolving packages...
error Couldn't find package "react" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this comm
and.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template --cwd C:\Amit\C
ode\Experiment\TestConsoleApp\login has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting login/ from C:\Amit\Code\Experiment\TestConsoleApp
Done.

Upvotes: 2

Views: 8132

Answers (2)

mbspark
mbspark

Reputation: 611

npm config set registry https://registry.npmjs.org/

...worked for me when having the same error

Upvotes: 14

Zotova Irina
Zotova Irina

Reputation: 116

Try to remove npm registry

npm config delete registry

Upvotes: 7

Related Questions