错误 eslint@5.6.0:引擎“节点”与此模块不兼容。尝试创建反应应用程序时

Alt*_*ian 6 homebrew node.js

我正在尝试创建一个 React 应用程序,但在我的控制台中出现以下错误。

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.10.1
info No lockfile found.
[1/4]   Resolving packages...
warning react-scripts > eslint > file-entry-cache > flat-cache > circular-   json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
[2/4]   Fetching packages...
error eslint@5.6.0: The engine "node" is incompatible with this module.    Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.5.0"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this     command.

Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd      /Volumes/server2/Desktop/JavaScript/birdcage has failed.

  Deleting generated file... package.json
  Deleting birdcage / from /Volumes/server2/Desktop/JavaScript
  Done.
Run Code Online (Sandbox Code Playgroud)

我试过了,brew upgrade node但这似乎不起作用。任何有关如何解决此问题的想法将不胜感激。

小智 11

我遇到了同样的问题,尝试在 create react app 推荐的末尾添加“--use-npm”。

create-react-app appname --use-npm


gil*_*niy 8

临时修复之一是运行 yarn install --ignore-engines


Alt*_*ian 0

我重新安装了node并更新了xcode开发者工具。另外,在运行 Mojave 的计算机上重新安装了 React。