我如何 运行 npm install 作为 Octopus Deploy 的一部分?

How can I run npm install as part of an Octopus Deploy?

我部署了我的nodejs网站之后,但在更新IIS虚拟目录之前,我需要从命令行执行npm install。

如何使用 Octopus Deploy 的脚本功能执行此操作?

要么加一个PreDeploy script with the command you want to run in your package or via the UI

我已将 Robert 的回答标记为正确答案,因为高级方法正是我所需要的。作为记录,这里是我使用的 PowerShell 脚本-

$installDirectory = $OctopusParameters[[=​​18=]]

cd $installDirectory

npm 安装 --silent