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

1
  • 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, 2021 at 2:15

2 Answers 2

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.

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 fixed my issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.