the content of 1.package.json is as follows:
{
"dev": "node server",
"start": "cross-env NODE_ENV=production node server",
"build": "node build/build.js",
"build:dll": "webpack --config build/webpack.dll.conf.js"
}
error when starting server using pm2 start npm-- start :
C:\PROGRAM FILES\NODEJS\NPM.CMD:1
0|admin-we | (function (exports, require, module, __filename, __dirname) { :: Created by npm, please don"t edit manually.
0|admin-we | ^
0|admin-we |
0|admin-we | SyntaxError: Unexpected token :
0|admin-we | at createScript (vm.js:80:10)
0|admin-we | at Object.runInThisContext (vm.js:139:10)
0|admin-we | at Module._compile (module.js:616:28)
0|admin-we | at Object.Module._extensions..js (module.js:663:10)
0|admin-we | at Module.load (module.js:565:32)
0|admin-we | at tryModuleLoad (module.js:505:12)
0|admin-we | at Function.Module._load (module.js:497:3)
0|admin-we | at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:83:21)
0|admin-we | at Module._compile (module.js:652:30)
0|admin-we | at Object.Module._extensions..js (module.js:663:10)
2. There is no problem running npm start directly, only after using pm2.