After creating a Vue project using vue cli, we can run it using
yarn run serve
I am not able to start using pm2. Running
pm2 start yarn -- run serve
I got a few crash-and-restart, after that, pm2 will stop to try to restart. In the log I can see
C:\PROGRAM FILES (X86)\YARN\BIN\YARN.CMD:1
(function (exports, require, module, __filename, __dirname) { @echo off
^
SyntaxError: Invalid or unexpected token
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Object.<anonymous> (C:\Users\Utente\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:27:21)
at Module._compile (internal/modules/cjs/loader.js:689:30)
I am running the pm2 command from the root of my project, where running yarn run serve
works without problem