'HTTPS'不被识别为内部或外部命令

问题描述 投票:0回答:1

我想在Windows中(作为Mac的虚拟机)运行React项目。

在命令提示符下,运行yarn以安装依赖项。我做了yarn start。它给了我'HTTPS' is not recognized as an internal or external command错误。

> yarn start
yarn run v1.13.0
$ HTTPS=true CERT=cert/localhost.crt KEY=cert/localhost.key umi dev
'HTTPS' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

有人知道如何解决此问题吗?

编辑1

我将节点升级到v12.16.1yarn升级到1.13.0,npm升级到6.13.4),并执行了yarn add httpsyarn add https-localhost。但是,yarn start仍返回'HTTPS' is not recognized as an internal or external command

[umi dev返回'umi' is not recognized as an internal or external command, operable program or batch file.

>umi dev
'umi' is not recognized as an internal or external command, 
operable program or batch file.
npm windows-10 command-prompt yarnpkg umijs
1个回答
0
投票

在Windows上,您需要像“ set HTTPS = true”中那样包含“ set”以设置环境变量。

© www.soinside.com 2019 - 2024. All rights reserved.