https://github.com/geerlingguy/ansible-for-devops/tree/master/nodejs
I downloaded and ran the playbook as is.
I get through all the tasks and it breaks at TASK [Check list of running Node.js apps.] with error below:
fatal: [192.168.56.55]: FAILED! => {"changed": false, "cmd": ["npx", "forever", "list"], "delta": "0:00:00.095020", "end": "2026-03-23 22:46:03.119842", "msg": "non-zero return code", "rc": 1, "start": "2026-03-23 22:46:03.024822", "stderr": "Invalid or unexpected token", "stderr_lines": ["Invalid or unexpected token"], "stdout": "", "stdout_lines": []}
I login directly to the server and try to run forever manually and get the same error.
[vagrant@nodejs ~]$ npx forever start /usr/local/opt/node/app/app.js
Invalid or unexpected token
I tried it another way, and got more output:
[vagrant@nodejs ~]$ forever start /usr/local/opt/node/app/app.js
/usr/local/lib/node_modules/forever/node_modules/@so-ric/colorspace/dist/index.cjs.js:418
const cc = c > 0.003_130_8
^^^^^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/local/lib/node_modules/forever/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js:1:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
https://github.com/geerlingguy/ansible-for-devops/tree/master/nodejs
I downloaded and ran the playbook as is.
I get through all the tasks and it breaks at TASK [Check list of running Node.js apps.] with error below:
I login directly to the server and try to run forever manually and get the same error.
I tried it another way, and got more output: