geerlingguy / geerlingguy/ansible-for-devops
Chapter 4 - Rocky Linux Node.js app server
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 3.8k
- PR merge metrics
- No merged PRs in 30d
Description
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. (/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)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the nodejs playbook linked in the issue and reproduce the failure at “Check list of running Node.js apps.” Compare the Node.js runtime with the syntax used by the installed forever dependency, using the shown npx and forever commands. Done means the playbook completes this task and the app server can start the example app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ansible, node.js
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100