Troubleshooting Node.js

Overview

This article lists a few steps you can take to troubleshoot your Node.js installation.

Passenger is not using your custom version of Node.js

If you find the custom version you installed is not being used, add the following code to an .htaccess file in your project's directory:

PassengerNodejs /home/username/.nvm/versions/node/v12.16.3/bin/node

Make sure to change the username and version to the version you have installed.

Next, reload Passenger by running the following command in the app's directory:

[server]$ mkdir tmp && touch restart.txt

In the future, you just need to touch the restart.txt file to restart the application.

[server]$ touch tmp/restart.txt

View the following page for further details:

Passenger is not loading the app.js file

If you've followed the instructions in the Enabling Passenger for Node.js article, you have added an app.js file and .htaccess file in your application directory. Make sure your .htaccess file does NOT contain the following line.

PassengerAppType node

This will cause Passenger to not load your app.js file.

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?