Next.js Discord

Discord Forum

Can't use pm2 to start & restart my next js app

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
I am using the script: pm2 start npm --name "FileSharingApp" -- run start
And i am getting in the logs:
7|nextjs-a | C:\PROGRAM FILES\NODEJS\NPM.CMD:1
7|nextjs-a | :: Created by npm, please don't edit manually.
7|nextjs-a | ^
7|nextjs-a |
7|nextjs-a | SyntaxError: Unexpected token ':'
7|nextjs-a |     at wrapSafe (node:internal/modules/cjs/loader:1486:18)
7|nextjs-a |     at Module._compile (node:internal/modules/cjs/loader:1528:20)
7|nextjs-a |     at Object..js (node:internal/modules/cjs/loader:1706:10)
7|nextjs-a |     at Module.load (node:internal/modules/cjs/loader:1289:32)
7|nextjs-a |     at Function._load (node:internal/modules/cjs/loader:1108:12)
7|nextjs-a |     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
7|nextjs-a |     at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
7|nextjs-a |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
7|nextjs-a |     at node:internal/main/run_main_module:36:49
7|nextjs-a |
7|nextjs-a | Node.js v22.14.0

0 Replies