Home > OS >  I get this error when trying to create a new React application
I get this error when trying to create a new React application

Time:11-21

I keep getting this E404 error in my shell when trying to create a react app. I may have deleted important files from my computer like an absolute noob. A possible solution I tried was using npm set registry https://registry.npmjs.org but this didn't help. I've been searching for ways to resolve this issue but haven't found a solution. Has anyone encountered this? Any advice? Thanks for reading!

npm get registry returns https://skimdb.npmjs.com/registry

Creating a new React app in /home/elilogbro/portfolio.

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

npm ERR! code E404
npm ERR! 404 Not Found - GET https://skimdb.npmjs.com/registry/lodash.sortby/-/lodash.sortby-4.7.0.tgz - not_found
npm ERR! 404
npm ERR! 404  'lodash.sortby@https://skimdb.npmjs.com/registry/lodash.sortby/-/lodash.sortby-4.7.0.tgz' is not in this registry.
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!     /home/elilogbro/.npm/_logs/2022-11-20T20_32_00_327Z-debug-0.log

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

Deleting generated file... package.json
Deleting portfolio/ from /home/elilogbro
Done.

CodePudding user response:

Try the following command (note the config)

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

NPM registry docs

CodePudding user response:

if you have installed create-react-app globally . uninstall it using

npm uninstall -g create-react-app

then run :

npx create-react-app your_app
  • Related