首页 > 解决方案 > 使用旧版本的节点创建 React App

问题描述

我正在尝试使用Create React App,但收到需要Node 10或更高版本的错误。我的节点版本是节点 8.10.0,我无法更新节点版本,因为它是一台工作机器。有什么方法可以运行旧版本的 Create React App 来使用我的旧 Node 版本?

标签: javascriptnode.jsreactjsnpmcreate-react-app

解决方案


我设法运行它。支持Node 8.xx的软件包的最新版本似乎是3.4.1 forcreate-react-app3.1.1 for react-scripts. 我做了什么:

npm uninstall -g create-react-app
npm install -g create-react-app@3.4.1
create-react-app my-app --scripts-version 3.1.1

但最好将您的 Node 版本更新为实际版本(或至少是 LTS)。


推荐阅读