[使用推荐的命令composer run-script docker:build
在Windows上安装Yii 2入门工具包时如何解决,为什么会发生此错误?
'cp' is not recognized as an internal or external command,
operable program or batch file.
Script cp .env.dist .env handling the build:env event returned with error code 1
Script @build:env was called via docker:build```
这是因为通常在Windows女士操作系统上,命令cp不可用当前必须在根目录的composer.json文件中对其进行编辑,scripts->build.env
部分必须已将cp
命令更改为copy
,以作为临时解决方法
scripts": {
"build:env": [
"cp .env.dist .env"
],
to
scripts": {
"build:env": [
"copy .env.dist .env"
],