7

http://nodejs-resume.example.me/

When the site loads,

/usr/local/dh/passenger/helper-scripts/node-loader.js:37
GLOBAL.PhusionPassenger = exports.PhusionPassenger = new EventEmitter();
^

ReferenceError: GLOBAL is not defined
    at Object.<anonymous> (/usr/local/dh/passenger/helper-scripts/node-loader.js:37:1)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47

I have modified my .htaccess to use node 15.5.0 I am hosting with DreamHost VPS

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
software is fun
  • 7,286
  • 18
  • 71
  • 129
  • I suggest you make the question title more specific, like “Dreamhost Passenger nodejs GLOBAL not defined”, and adding a nodejs-related tag to it. And I’m suggesting this because I also want to know the answer ASAP if anyone figures it out ;) – owengall Apr 26 '21 at 02:15

2 Answers2

5

I believe this error is because the uppercase GLOBAL alias for global was deprecated as of nodejs v14 (or some version near that). As warned here:

The version of Passenger running on DreamHost servers does not currently function with Node.js versions 14+.

you need to use a version of node older than v14 in order for passenger to work. I downgraded node to v13 and this solved the issue for me.

owengall
  • 455
  • 4
  • 11
0

Please change the Object name GLOBAL to global in the mentioned file. Then restart the web Server(eg. nginx, appache). In my case this was fix my issue.

Denesh
  • 21
  • 6