gpt4 book ai didi

node.js - 发现不兼容的模块 Node -不支持-创建 react 应用程序

转载 作者:行者123 更新时间:2023-12-04 18:44:02 25 4
gpt4 key购买 nike

当我尝试在我的计算机上安装 react/babel 时遇到问题。如果有人可以提供帮助,我将不胜感激。

我正在运行 Ubuntu Ubuntu 20.04 LTSnode -v 14.4.0,所以文档没问题。npm -v是 6.14.5

问题是,每次我运行命令 npx create-react-app my-app ,我收到此错误:

Creating a new React app in /home/leni/Desktop/Tests/bla/my-app.

**warning You are using Node "15.0.0-nightly202006043a7a5d7e62"** which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
(node:102555) [DEP0139] **DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability**.
(Use `node --trace-deprecation ...` to show where the warning was created)
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.4
warning You are using Node "15.0.0-nightly202006043a7a5d7e62" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
(node:102590) [DEP0139] DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability.
(Use `node --trace-deprecation ...` to show where the warning was created)
[1/4] Resolving packages...
[2/4] Fetching packages...
**error @babel/core@7.9.0: The engine "node" is incompatible with this module.** **Expected version ">=6.9.0". Got "15.0.0-nightly202006043a7a5d7e62"**
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 cra-template --cwd /home/leni/Desktop/Tests/bla/my-app has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting my-app/ from /home/leni/Desktop/Tests/bla
Done.

我确定我使用的是 Node v14.4.0,但每次我尝试创建一个 react 项目时,我都会遇到失败,知道如何解决这个问题吗?我尝试使用 Next.js 也一样,但我遇到了同样的问题。

非常感谢你的帮助。
莱尼

最佳答案

我刚刚遇到了同样的错误。确保您没有通过 Ubuntu 软件“商店”安装 Node 应用程序。删除它为我解决了这个问题。

关于node.js - 发现不兼容的模块 Node -不支持-创建 react 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62205153/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com