【发布时间】:2021-11-27 19:05:02
【问题描述】:
我尝试使用命令创建一个新的 react 应用程序
npx create-react-app my-app
加载需要一些时间,但在安装软件包时出现以下错误:
npx: installed 67 in 3.337s
Creating a new React app in /home/Github/my-app.
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://registry.npmjs.org/@svgr%2fbabel-preset - Not found
npm ERR! 404
npm ERR! 404 '@svgr/babel-preset@^5.5.0' 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 It was specified as a dependency of '@svgr/plugin-jsx'
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/.npm/_logs/2021-10-07T17_20_12_439Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from /home/Github/Amazon-Clone
Done.
github上有一些讨论,但对我来说效果不佳。 我已经重试了很多次,也尝试在新文件夹中创建它。
【问题讨论】:
-
检查 npm 的状态是否正常。从这个链接:status.npmjs.org
标签: node.js reactjs react-native npm