如果您在运行"create-react-app --version"命令时收到"'create-react-app' is not recognized as an internal or external command, operable program or batch file"错误消息,这意味着您的计算机上没有全局安装create-react-app。

要查看create-react-app版本和Webpack版本,您可以在项目的根目录中使用以下命令:

  1. 打开终端或命令提示符。
  2. 导航到您的项目文件夹。

对于使用yarn创建的项目: 3. 运行命令"yarn create react-app my-app"创建一个新的create-react-app项目(如果您已经创建了项目,请跳过此步骤)。 4. 运行命令"cd my-app"进入项目文件夹。 5. 运行命令"yarn react-scripts --version"来查看create-react-app版本。

对于使用npm创建的项目: 3. 运行命令"npx create-react-app my-app"创建一个新的create-react-app项目(如果您已经创建了项目,请跳过此步骤)。 4. 运行命令"cd my-app"进入项目文件夹。 5. 运行命令"npm run react-scripts --version"来查看create-react-app版本。

注意:create-react-app的版本号是通过查看项目中的react-scripts包的版本号来确定的。

使用create-react-app和yarn创建的项目如何查看create-react-app版本和Webpack版本 我运行create-react-app --version命令查看create-react-app版本后提示create-react-app is not recognized as an internal or external commandoperable program

原文地址: https://www.cveoy.top/t/topic/jay2 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录