React : create-react-app 为包 error-ex 引发 404

React : create-react-app raises a 404 for package error-ex

我全新安装了 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

的包

(同样使用纱线。)

我该如何解决这个问题?

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

解决问题:

  • 使用来自欧洲某个地方的 VPN,你会没事的。

这是一个全局 issue .. Here is a workaround that works for now, you could use the public npm registry 镜像:

就运行:

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