【发布时间】:2019-12-16 14:22:40
【问题描述】:
一切都在标题中:我正在尝试按照本教程创建一个反应应用程序:https://github.com/facebook/create-react-app
但它立即失败了:
[user@localhost workspace]$ create-react-app projectname
Creating a new React app in projectpath/projectname.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
warning react-scripts > workbox-webpack-plugin > workbox-build > strip-comments > babel-plugin-transform-object-rest-spread > babel-runtime > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-scripts > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
[2/4] Fetching packages...
error eslint@6.7.2: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1".
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 projectpath/projectname has failed.
从“引擎“节点”与此模块不兼容。预期版本”我推断我的节点不是最新的。然而:
sudo n stable 给我:
已安装:v12.13.1 到 /usr/local/bin/node
活动:/bin/node 上的 v10.16.3
nvm use stable 给我:
现在使用节点 v10.0.0 (npm v6.13.4)
node -v 给我:
v10.0.0
有人有解决这个问题的想法吗? 提前感谢您的回答。
【问题讨论】:
-
node -v提供了什么? -
eslint@6.7.2 可用于节点 10.13.0,或高于 11.10.1 的版本。您是否尝试安装 10.13.0 或更高版本?
-
尝试使用带有
--ignore-engines开关的yarn。 -
@JoseVasquez 实际上我意识到我正在使用
sudo n stable,但它并没有给我 node.js 的最新版本。我刚刚使用了sudo n latest,它给了我:`已安装:v13.3.0 到/usr/local/bin/node 活动:v10.16.3 在/bin/node`你知道我怎样才能使“安装”版本成为“活跃”一个? -
@Zydnar 我刚刚尝试了您的解决方案,不幸的是问题仍然存在:/ 谢谢您的建议
标签: javascript node.js reactjs create-react-app