【问题标题】:React : create-react-app raises a 404 for package error-exReact:create-react-app 为包 error-ex 引发 404
【发布时间】: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 是的,所有其他包都找到了(我试过reactreact-router-dom@material-ui/core)除了error-ex之外,它们都返回响应。

标签: node.js reactjs npm create-react-app yarnpkg


【解决方案1】:

这是一个全局的issue .. 这是一个暂时可行的解决方法,您可以使用公共的npm registry 镜像:

只要运行:

npm config set registry https://skimdb.npmjs.com/registry

【讨论】:

    【解决方案2】:

    似乎 NPM 正在阻止任何包含 error 的请求(对我来说也没有意义)。

    解决问题:

    • 使用来自欧洲某处的 VPN,您会没事的。

    【讨论】:

      猜你喜欢
      • 2020-05-28
      • 2020-05-27
      • 2020-05-28
      • 2019-03-08
      • 2022-01-20
      • 2014-09-23
      • 2022-12-02
      • 2020-05-27
      • 2023-03-17
      相关资源
      最近更新 更多