【问题标题】:Error : create-react-app Aborting installation错误:create-react-app 正在中止安装
【发布时间】:2020-05-28 13:03:05
【问题描述】:

根据Reactjs 文档:

您需要在您的机器上安装 Node >= 8.10 和 npm >= 5.6。要创建项目,请运行:

npx create-react-app my-app

我的环境符合它:

AymanMorsy@DESKTOP-6V4567D MINGW64 /g/reactprojects
$ node --version && npm --version ????????
v12.16.0 ????????
6.13.4 ????????

AymanMorsy@DESKTOP-6V4567D MINGW64 /g/reactprojects
$ npx create-react-app my-app
npx: installed 99 in 17.908s

Creating a new React app in G:\reactprojects\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/error-ex/-/error-ex-1.3.2.tgz
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!     C:\Users\AymanMorsy\AppData\Roaming\npm-cache\_logs\2020-02-12T21_29_30_123Z-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 G:\reactprojects
Done.

我在Create React App not installing, showing an error and aborting installation上尝试了解决方案

最后我格式化C并安装了windows10的最新更新,仍然看到同样的问题

编辑: npm 配置列表的输出

$ npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.13.4 node/v12.16.0 win32 x64"

; builtin config undefined
prefix = "C:\\Users\\AymanMorsy\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = G:\reactprojects
; HOME = C:\Users\AymanMorsy
; "npm config ls -l" to show all defaults.

【问题讨论】:

  • npm config list 输出什么?
  • @evolutionxbox 我现在添加了它。
  • 这可能是直接与 npm status.npmjs.org相关的问题
  • 我在访问此链接时看到404 Errors with Certain Packages :(
  • 确实如此。这就是我发布它的原因。

标签: javascript node.js reactjs npm


【解决方案1】:

看起来https://registry.npmjs.org/error-ex 在某些地区已关闭

很快就到了

【讨论】:

    【解决方案2】:

    以下解决方案⤵ 安装独家新闻 然后安装 yarn 然后做yarn create-react-app myapp100% 肯定工作

    【讨论】:

      【解决方案3】:

      就我而言,防病毒软件阻止了某些模块被访问。关掉它,还安装了纱线。工作正常

      1. 暂时停止杀毒软件。

      2. npm install -g 纱线

      3. yarn 全局添加 create-react-app

      4. npx create-react-app my-app

      5. 启动杀毒软件

      虽然我觉得在我的情况下,纱线不是解决这个问题的强制性 - 我更喜欢纱线。 希望这对那里的人有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-13
        • 2020-10-29
        • 2022-01-23
        • 2016-12-09
        • 2019-08-17
        • 2019-07-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多