简体   繁体   English

如何在 Windows 上用 pm2 启动 yarn 脚本?

[英]How to start a yarn script with pm2 on Windows?

I'm in a project using yarn and want to start one of the scripts in the package.json with pm2 using this command:我在一个使用 yarn 的项目中,想使用以下命令使用 pm2 启动package.json中的脚本之一:

pm2 start "yarn start"

It results in:结果是:

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

I also tried:我也试过:

pm2 start yarn -- start

Which gets me:这让我:

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

The package.json is located at C:\path\to\project\package.json and has a script called "start". package.json位于C:\path\to\project\package.json并有一个名为“start”的脚本。

yarn run pm2 start server.js纱线运行 pm2 启动 server.js

You must be in your target directory您必须在目标目录中

This is our solution to running pm2 with snap这是我们用 snap 运行 pm2 的解决方案

still working on startup script for yarn pm2仍在为 yarn pm2 编写启动脚本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM