reactjs 尝试创建新React应用程序时出现此错误

4nkexdtk  于 2022-11-22  发布在  React
关注(0)|答案(2)|浏览(100)

我在尝试创建一个react应用程序时,在我的shell中不断出现这个E404错误。我可能像个菜鸟一样从我的计算机中删除了重要文件。我尝试过使用npm set registry https://registry.npmjs.org的可能解决方案,但没有帮助。我一直在寻找解决这个问题的方法,但还没有找到解决方案。有人遇到过这个问题吗?有什么建议吗?谢谢阅读!
npm get registry返回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.
tjjdgumg

tjjdgumg1#

尝试以下命令(注意配置)

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

NPM registry docs

nzk0hqpo

nzk0hqpo2#

如果你已经全局安装了create-react-app。卸载它使用

npm uninstall -g create-react-app

然后运行:

npx create-react-app your_app

相关问题