我想在我的Windows上运行一个React项目(作为我的Mac的虚拟机)。
在命令提示符中,运行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:
我将node升级到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' 不是内部或外部命令,也不是可运行的程序或批处理文件。
:
>umi dev
'umi' is not recognized as an internal or external command,
operable program or batch file.
$ HTTPS=true CERT=cert/localhost.crt KEY=cert/localhost.key umi dev
- 这看起来像是一个 shell 命令(Bourne/bash/Unix/Linux/POSIX),它在设置变量HTTPS
、CERT
和KEY
后调用了命令umi dev
。我不熟悉 React 或 Yarn,但是它可能不支持 Windows,或者有些配置错误导致它认为它在类 Unix 系统上。 - Keith ThompsonHTTPS=true
PORT=8080
HOST=localhost
- Maf