This article lists a few steps you can take to troubleshoot your Node.js installation.
The version of Passenger running on DreamHost servers does not currently function with Node.js versions 14+.
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:
Make sure to change the username to your Shell user, 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.
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
- Navigate to the Hosted Domains page.
- Click the Web Hosting column. link to the right of your domain, under the
- Scroll down and click the Change settings button to save.
- Wait 5 minutes, then view your site.
VPS and dedicated servers
Error logging in Node.js
You can specify custom output and error log locations when launching your Node.js app using the command below. Make sure to change the app name to your app before running the command.
[server]$ node example.js > node_log.log 2> node_error.log