【发布时间】:2019-09-27 09:39:10
【问题描述】:
使用 vue cli 创建 Vue 项目后,我们可以使用运行它
yarn run serve
我无法开始使用 pm2。跑步
pm2 start yarn -- run serve
我遇到了几次崩溃和重启,之后,pm2 将停止尝试重启。 在日志中我可以看到
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)
我从项目的根目录运行 pm2 命令,运行 yarn run serve 没有问题
【问题讨论】: