【发布时间】:2020-05-28 05:47:32
【问题描述】:
我全新安装了 Linux Mint 19。
我刚刚安装了NodeJs 13.8.0(最新不是 LTS)和npm 6.13.6。
我正在尝试使用 npx create-react-app <app_name> 创建一个 React 应用程序,但它引发了 404。
终端是这样说的:
(env) Dj@EliteBook:~/projects/optic/front$ npx create-react-app .
npx: installed 99 in 12.424s
Creating a new React app in /home/Dj/projects/optic/front.
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/error-ex
npm ERR! 404
npm ERR! 404 'error-ex@^1.3.1' 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 'parse-json'
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/Dj/.npm/_logs/2020-02-12T16_43_36_342Z-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 front/ from /home/Dj/projects/optic
Done.
i went to this error-ex url and indeed it says 404. 但它是一个名为 parse-json 的包的依赖项
(使用纱线也是如此。)
我该如何解决这个问题?
【问题讨论】:
-
您链接的网站现在正在为我工作。也许有什么东西阻止了你?
-
@JCQuintas 我会检查我的防火墙(虽然它已经关闭)
-
@JCQuintas 我不知道为什么它不起作用。
-
我帮不了多少人。尝试 ping
https://registry.npmjs.org/error-ex看看会发生什么?重置路由器?检查 npm 的注册表服务的状态?这很可能是您的问题,因为您也无法连接到实际网站。你能连接到其他registry包吗? registry.npmjs.org/react -
@JCQuintas 是的,所有其他包都找到了(我试过
react、react-router-dom、@material-ui/core)除了error-ex之外,它们都返回响应。
标签: node.js reactjs npm create-react-app yarnpkg