简体   繁体   English

Create-react-app 和过时的节点版本

[英]Create-react-app and outdated node version

When i'm trying to create a new react app using standard create-react-app tut1 i'm getting:当我尝试使用标准 create-react-app tut1 创建一个新的反应应用程序时,我得到:

You are running Node v12.18.3.您正在运行 Node v12.18.3。
Create React App requires Node >=14.0.0 or higher.创建 React App 需要 Node >=14.0.0 或更高版本。
Please update your version of Node.请更新您的 Node.js 版本。

I's strange because I've already updated botch npm & node using:我很奇怪,因为我已经更新了npm & node使用:

install npm@latest -g 

and

npm install -g node@latest

moreover when i type npm list -g node i get node@17.3.0 BUT when i check the node version node -v i get indeed old v12.18.3 , Why are there such discrepancies?此外,当我输入npm list -g node我得到node@17.3.0但是当我检查节点版本node -v我确实是旧的v12.18.3时,为什么会有这样的差异?

That's not the way to install node.这不是安装节点的方式。 Use nvm on Linux and nvs on Windows.在 Linux 上使用nvm ,在Windows上使用 nvs。

Node is a runtime environment that provides the NPM module. Node 是提供 NPM 模块的运行时环境。 Also,还,

node -v

will tell you the exact version of node you are running and would have installed earlier.将告诉您正在运行的节点的确切版本,并且会更早安装。 npm or Node package manager gets installed with it when you install node.安装节点时,npm 或节点 package 管理器会随之安装。 You can get the latest version from the link below.您可以从下面的链接获取最新版本。

https://nodejs.org/en/download/ https://nodejs.org/en/download/

You would have to uninstall your existing node.js version and install the latest or LTS version from https://nodejs.org/en您必须卸载现有的 node.js 版本并从https://nodejs.org/en安装最新或 LTS 版本

The correct way to check your Node version is node -v检查 Node 版本的正确方法是 node -v

Node.js is runtime and npm is a cli that runs on top of Node and requires that Node runtime is available. Node.js 是运行时,npm 是运行在 Node 之上的 cli,需要 Node 运行时可用。

npm is the package manager for the Node JavaScript platform. npm 是 Node JavaScript 平台的 package 管理器。 It let's you install software libraries, plugins, frameworks and applications but not Node itself.它可以让你安装软件库、插件、框架和应用程序,但不能安装 Node 本身。

npm comes bundled with Node, but you should be able to install an updated npm package. npm 与 Node 捆绑在一起,但您应该能够安装更新的 npm package。

It is possible to install multiple Node versions, see https://docs.npmjs.com/downloading-and-installing-node-js-and-npm for details.可以安装多个 Node 版本,详见https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

Check out NVM (node version manager).查看 NVM(节点版本管理器)。 Essentially you can create a.nvmrc file that has the version of node you want for this project.本质上,您可以创建一个 .nvmrc 文件,其中包含该项目所需的节点版本。 Then run nvm install at the location of your project.然后在项目所在的位置运行 nvm install 。 This will set the terminal to use the node version you specified.这会将终端设置为使用您指定的节点版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 create-react-app 不支持的节点版本 - create-react-app unsupported node version 没有提供模板。 这可能是因为您使用的是过时版本的 create-react-app - A template was not provided. This is likely because you're using an outdated version of create-react-app 没有提供模板。 这可能是因为您使用的是过时版本的 create-react-app(NPM 问题) - A template was not provided. This is likely because you're using an outdated version of create-react-app (NPM issue) 当我尝试创建 React 应用程序时,出现“未提供模板,这可能是因为您使用的是过时版本的 create-react-app”错误 - when i try to create react app ,i get " template was not provided ,This is likely because you're using an outdated version of create-react-app " Error Create-react-app 依赖版本问题 - Create-react-app dependency version issues create-react-app 落后于最新版本 - create-react-app is behind the latest version Node 应用程序是否有等效的 create-react-app? - Is there an equivalent of create-react-app for Node apps? 如何使用特定版本的create-react-app创建react项目? - How to create a react project with specific version of create-react-app? 如何将使用 create-react-app 构建的 React 项目升级到下一个 create-react-app 版本? - How to upgrade a React project built with create-react-app to the next create-react-app version? Create-React-App 生产版与开发版不同 - Create-React-App production version differs from developer version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM