我想在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.1
(yarn
升级到1.13.0
,npm升级到6.13.4
),并执行了yarn add https
和yarn 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.
在Windows上,您需要像“ set HTTPS = true”中那样包含“ set”以设置环境变量。