我希望能够在将运行node script1.js
的项目目录中执行命令script1
。
script1.js
是同一目录下的一个文件。该命令需要特定于项目目录,这意味着如果我将项目文件夹发送给其他人,他们将能够运行相同的命令。
到目前为止,我尝试添加:
"scripts": {
"script1": "node script1.js"
}
我的包裹。json文件,但当我尝试运行script1
时,我得到以下输出:
zsh: command not found: script1
有人知道将上面提到的脚本添加到项目文件夹的必要步骤吗?
*注意:该命令不能添加到bash配置文件(不能是特定于机器的命令)
如果你需要澄清,请告诉我。