纱线在后台服务

mam*_*mad 5 npm vue.js yarnpkg cypress

我正在尝试在我的 vue 应用程序上配置 gitlab CI/CD 进行 cypress e2e 测试,该应用程序使用纱线进行包管理。cypress文档都是为npm写的cypress gitlab ci/cd 配置教程

# start the server in the background
- npm run start:ci &
# run Cypress tests
- npx cypress run --browser firefox
Run Code Online (Sandbox Code Playgroud)

有没有办法在后台启动纱线服务器?就像在后台运行纱线服务一样。

Mik*_* D. 2

命令有问题yarn serve&。编译完成后,它仍然会给你这个屏幕: 在此输入图像描述

我找到了一种通过pm2这个命令来解决这个问题的方法

pm2 start yarn --interpreter bash --name api -- start
Run Code Online (Sandbox Code Playgroud)