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 application 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 -p tmp && touch tmp/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.

Changes to my app are not updating

If you're using Passenger, changes to your app will immediately update. If you find the changes have not updated, you can try the following two options.

touch the restart.txt file

Run the touch tmp/restart.txt command as mentioned in the section above.

Re-save your domain settings in the panel

  1. Navigate to the Manage Domains page.
  2. Click the Edit link to the right of your domain, under the Web Hosting column.
  3. Scroll down and click the Change settings button to save.
  4. Wait 5 minutes, then view your site.

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?