Plesk: Using nodejs results in an error "Cannot find module 'phusion_passenger/line_reader'

387 Views Asked by At

Having an issue with Plesk and nodejs-extension using phusion passenger.

My Plesk Version: Plesk Obsidian 18.0.31 Update #2

My OS: Ubuntu 18.04.5 LTS

Using nodejs 12.4.0 which is primarly installed via plesk.

I set up two domains. On both i run npm install via the plesk ui. Everything works and nothing results in an error, until I head to the domains, I got following error messages within development mode:

On domain 1:

Domain 1 error

On domain 2

Domain 2 error

Its a bit confusing since everything seems to work fine.

I have already tried to set an Environment variable in /etc/nginx/conf.d/phusion-passenger.conf:

passenger_env_var NODE_PATH /usr/share/passenger/node;

Reason is that in phusion passengers github somebody recommends this within an issue. And in /usr/share/passenger/node/phusion-passenger/ I found the line_reader.js.

But this doesn't solve the problem.

Thanks for helping me out

1

There are 1 best solutions below

1
On

So I figured out, that the path-variables aren't correct for phusion to work. After editing them hard in the code everything works fine.

I am still not happy about this solution. So if anyone knows another option to solve this. please suggest.