我需要使用 create-react-app
版本为 1.0.10 创建一个新的 React 应用程序。但是,当我执行 create-react-app myProject
时,它自动使用那个时间可用的最新版本的 create-react-app
。是否有任何命令可以让 create-react-app 使用特定版本来创建项目模板?
我需要使用 create-react-app
版本为 1.0.10 创建一个新的 React 应用程序。但是,当我执行 create-react-app myProject
时,它自动使用那个时间可用的最新版本的 create-react-app
。是否有任何命令可以让 create-react-app 使用特定版本来创建项目模板?
npm install create-react-app@1.0.10
。很可能它是全局安装的,所以你需要在本地安装它,然后从那里运行它。 - Henrik Anderssoncreate-react-app
是一个全局包,因此您的计算机上全局安装了该软件包的1个版本,无论您在计算机的哪个位置,都可以键入create-react-app myProject
。正如 @HenrikAndersson 建议的那样,如果您全局安装了特定版本:npm -g install create-react-app@1.0.10
,每次使用它时,它将是该版本。 - maxgallo