【发布时间】:2020-10-23 14:35:07
【问题描述】:
我的 package.json 中有以下脚本键/属性条目
"stop": "source .env && yarn doc:stop && lsof -t -i tcp:$EXPRESS_PORT | xargs kill 2> /dev/null && pgrep -f $(pwd) | xargs kill 2> /dev/null",
当我执行时它不起作用
yarn stop
它会抛出以下错误
/bin/sh: 1: source: not found
但我可以直接从 Ubuntu 命令终端调用 execute 而不会出错
source .env
我在使用 . (点)而不是来源。
/bin/sh: 1: .: .env: not found
我该如何解决?
谢谢
【问题讨论】: