npm run .sh脚本文件识别不了问题

/post/npm-sh article cover image

在使用npm或者yarn执行script脚本为.sh文件时,windows下报错识别不了

. is not recognized as an internal or external command, operable program or batch file

在执行脚本前增加 sh 或者 bash 命令(基于终端的支持))

json
{
  "setup": "sh ./scripts/setup.sh",
  "setup": "bash ./scripts/setup.sh"
}

使用相对路径

json
{
  "setup": "D:/Traning/lowcode-engine/scripts/setup.sh"
}