A Node.js app that runs on your computer can still die as soon as a host starts it. Common Node.js hosting errors usually sit in one of three layers: the application, the process manager that keeps it running, or the reverse proxy that accepts visitors and forwards requests. Name that layer from the log before editing code. Start with the symptom, not with a command copied from a laptop. A stopped process, a missing module, and an account memory limit are different repairs, and each one leaves a different line in the log.
How do you tell which part of the host is failing?
Node.js hosting errors split across the process, the process manager, and the reverse proxy. Read the symptom before opening the project. “It worked on my computer” only means the server environment differs from the laptop. Pick the matching row, then go to the section for that layer.
What you see | Layer to check |
A stack trace, or the panel says the app stopped | Application startup |
EADDRINUSE, or the app listens on a port the proxy does not use | Port and reverse proxy |
The proxy log says connection refused and the app log is empty | Process not running |
The error names a database or API hostname | Outbound configuration, not the visitor-facing web server |
In Nginx, a 502 Bad Gateway means the proxy did not receive a valid response from the upstream it was told to call. The status code does not name the bug. The Nginx proxy module describes that upstream relationship.
Where do you read the error that stopped the app?
Open the log that belongs to the layer you just chose, and copy the first error plus the file path before you restart anything. A restart can drop the lines you need.
On a cPanel-style Node.js screen, use the application log inside that screen. The domain’s PHP error log is a different file and will not show a proxied Node crash.
With PM2, run pm2 logs for that app. If those lines are clean, open the proxy error log next. PM2’s log command is the VPS path.
With systemd, use journalctl -u for that service, then the proxy log if the service itself printed nothing.
Host panels rarely publish one universal log path. Use the log the application screen already shows rather than guessing a filename. Later edits are much harder once that first error is gone.
Why does a Node.js app fail to start or show 502 or 503?
Most “failed to start” reports come from two hosting causes: the panel points at the wrong entry file, or the process throws before it can listen. The proxy then has nothing to forward to. If the saved log says the address is already in use, or that a port was refused for lack of permission, use the port section instead.
The startup file or application root is wrong
The application root and the startup file have to match the upload. That file is often app.js, server.js, or dist/index.js. A build folder that never left your computer is a missing entry, not a Node.js defect.
The panel’s start action can ignore the npm start script you use locally. Point the startup field at a file that exists in that folder, with the same spelling, then start the app from the panel again.
The app exits before it can serve requests
A throw while the file loads ends the process, and the proxy returns 502 or 503 because the upstream socket is gone. Read the first stack frame. It may be a bad import, a missing setting, or a client that throws before listen runs. Fix that frame and start the app again.
Saving a file does not reload Node.js. The running process stays in memory until the panel, PM2, or systemd starts it again.
Why does the port or the reverse proxy reject the app?
Shared app hosting assigns the port. A VPS expects Node.js on a high port and the web server on 80 and 443. EADDRINUSE means something already holds the address the app asked for. Hard-coding 3000 fails when the platform injected a different port, and binding port 80 inside Node.js fails on a normal account because that port is privileged.
On shared or managed app hosting, call app.listen(process.env.PORT). A fixed 3000 is a common reason the process never stays up.
On a VPS, identify the current listener with ss before you stop anything. Remove a duplicate PM2 app or a Node process left in an old SSH session. Leave PIDs you do not recognise alone.
Bind to 127.0.0.1 when Nginx or Apache is on the same machine. Bind to 0.0.0.0 only when the platform connects to the app from outside that interface.
Leave ports below 1024 to the web server. Node’s error documentation covers EADDRINUSE and EACCES on listen. Point Nginx proxy_pass at the port the app bound.
Warning: On shared hosting, killing whatever holds a port can stop a process the account does not own. Change the app’s listen port, or remove only the duplicate you started.
Why can’t the server find a module or the right Node.js version?
MODULE_NOT_FOUND after deploy means this Node.js binary searched its module path and missed the package or file. A laptop install does not fill that path. Read the quoted name in the log before you install anything again.
Packages were installed outside the app environment
On a Node.js selector, install with that app’s NPM Install action or from inside its virtual environment. An SSH npm install on the system Node can write node_modules where this app never looks.
Do not upload node_modules from Windows or macOS. Build native addons on the server, or the log can say the module did not self-register. A production install skips devDependencies, so a runtime package belongs in dependencies. Node’s module resolution explains the miss. On Linux, Express and express are different names.
The Node.js version on the host does not match the app
Match the selector, or the VPS binary, to the major version in engines and to the version you used locally. After a switch, install again and rebuild native addons.
HostCry’s Node.js page lists 18.x, 20.x, 22.x, and 24.x as LTS. The Node.js release table currently marks 18 and 20 end-of-life, and 22, 24, and 26 as LTS. Stay on a line that table still marks LTS, and recheck the selector on deploy day. Do not choose an end-of-life line only because a plan page still shows it.
Which settings does the host fail to pass into the app?
A variable in your local shell is missing until the host puts it into the process. Compare PORT, NODE_ENV, the database URL, and any API key with the names the app reads. PORT is only one of those values. Binding rules stay in the port section.
Put production values in the panel’s environment list, or in PM2’s env_production block. A .env file is loaded only if the app reads it before anything else uses process.env.
Restart after every change. A value saved in the panel stays invisible to the old process.
PM2 captures the environment at start. A later export in the shell is ignored until you refresh it. PM2 documents that refresh as --update-env.
NODE_ENV=production changes how libraries cache and how much they print. The crash can go quiet after that switch even though the missing name is unchanged.
Use placeholders such as YOUR_DATABASE_URL in samples. HostCry’s Node.js plans include environment variables in the panel.
When is memory, CPU, or a process limit the cause?
A memory failure during live traffic is not the same event as a failure during npm install or npm run build. Raising the heap flag does not fix both. On a small account it can make the kill happen sooner.
The running app exceeds its memory limit
A JavaScript heap message means V8 asked for more heap than it was allowed. A platform kill shows up in the system log, or as a climbing PM2 restart counter, while the app log may only say the process ended.
Shrink retained caches first. Use --max-old-space-size only after you know the plan’s RAM. Node’s CLI documentation defines the flag in megabytes. The default heap changes by version, so do not copy a single number.
Warning: A heap of 4096 does not add RAM the plan never gave you. The account limiter still stops the process.
The install or the build is what runs out of memory
If the failing command is npm install or npm run build, the live server is not what ran out of heap.
Build on your development machine.
Upload that output, such as dist or the framework build folder.
On the server, run a production install only. Do not compile there again.
Which file and permission errors appear only on the server?
ENOENT with a path, EACCES on a file, or a filename that differs only by capital letters, is a disk problem created by the upload. Linux treats App.js and app.js as different files. Windows does not. The process runs as the account user, so a file owned by someone else stays unreadable even when the path looks right. The working directory is the application root, not whatever folder your laptop shell was in.
Keep the application files outside the public web root when the platform proxies to the app. Source and .env files left under that root can be downloaded directly.
Warning: Do not run chmod 777, and do not start the app as root to get past EACCES. Fix the owner so the app user can read the file. Wide permissions and a root process are how a small path bug becomes an account risk.
Should you change the application or the hosting plan?
Change the app or the panel when the log names a file, a module, a variable, or a port. Move to a larger plan only when that same build stays up elsewhere and this account is what stops the process.
Before the next deploy, confirm each item once:
The Node.js version is still listed as LTS.
Dependencies were installed in the app environment.
PORT comes from the environment.
Production variables are present.
Built files were uploaded.
The app was restarted after that upload.
Shared hosting and Node.js hosting are different products. HostCry lists Max Passenger Applications as 0 on shared Starter and 4 on Professional and Advance. Node.js plans describe PM2 and list 4 GB, 6 GB, and 16 GB of RAM. Recheck the tables. “Unlimited” still depends on free resources, and a Starter shared account with no Passenger allowance will not start Node.js from a toggle.
Use shared hosting for PHP sites that do not need a Node.js process.
Save the log, then change one cause
The log names the layer, so change the plan only when that layer is the account limit: save the log, change one cause, restart, and read the log again. HostCry says it has provided hosting since 2017, and the current Node.js hosting plans show the version switcher and memory limit, or support can confirm both for the account. Readers paying in AED can compare those limits on the UAE hosting pages.