【问题标题】:How to start a yarn script with pm2 on Windows?如何在 Windows 上使用 pm2 启动 yarn 脚本?
【发布时间】:2023-01-12 13:04:54
【问题描述】:

我在一个使用 yarn 的项目中,想使用以下命令使用 pm2 启动 package.json 中的脚本之一:

pm2 start "yarn start"

结果是:

[PM2] Applying action restartProcessId on app [yarn](ids: [ 0 ])
[PM2][ERROR] Process 0 not found 

我也试过:

pm2 start yarn -- start

这让我:

[PM2][ERROR] Script not found: C:\path\to\project\yarn start

package.json 位于C:\path\to\project\package.json 并且有一个名为“start”的脚本。

【问题讨论】:

    标签: node.js windows npm yarnpkg pm2


    【解决方案1】:

    纱线运行 pm2 启动 server.js

    您必须在目标目录中

    这是我们用 snap 运行 pm2 的解决方案

    仍在为 yarn pm2 编写启动脚本

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-18
      • 2020-08-20
      • 2021-06-24
      • 1970-01-01
      相关资源
      最近更新 更多