Questions tagged «run-script»

5
如何在运行JavaScript文件的package.json文件中添加自定义脚本?
我希望能够script1在将要运行的项目目录中执行命令node script1.js。 script1.js是同一目录中的文件。该命令必须特定于项目目录,这意味着如果我将项目文件夹发送给其他人,他们将能够运行相同的命令。 到目前为止,我尝试添加: "scripts": { "script1": "node script1.js" } 到我的package.json文件,但是当我尝试运行时script1,得到以下输出: zsh: command not found: script1 有谁知道将上述脚本添加到项目文件夹的必要步骤? *注意:该命令不能添加到bash配置文件中(不能是计算机专用命令) 如果您需要任何说明,请告诉我。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.