Troubleshooting "Deploy failed" errors¶
Here you will find the most common scenarios where a deployment can fail.
When a deployment fails, you will see the following at the bottom of your last "deployment log":
The node_modules
folder should not be on git¶
Possible errors:
Solution:
Remove the node_modules
directory from your git repository,
Then, try to deploy again.
Not having the package.json
in the root of your git project¶
Symptom:
Error Output:
================
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/deploy/source/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/deploy/source/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/deploy/.npm/_logs/2023-07-17T18_31_07_252Z-debug-0.log
post-deploy hook failed
Deploy failed
Deploy failed with exit code: 1
Possible solutions:
- Move your server files to the git root path.
- Alternatively, update the "Root Directory" from your Application's "Settings" page, under "Build settings":
Missing, or bad ecosystem.config.js
file¶
Symptom:
Error: Process list empty, cannot save empty list
at fin (/usr/lib/node_modules/pm2/lib/API/Startup.js:448:23)
at ex (/usr/lib/node_modules/pm2/lib/API/Startup.js:492:30)
at /usr/lib/node_modules/pm2/lib/API/Startup.js:500:9
at /usr/lib/node_modules/pm2/node_modules/pm2-axon-rpc/lib/client.js:45:10
at Parser.<anonymous> (/usr/lib/node_modules/pm2/node_modules/pm2-axon/lib/sockets/req.js:67:8)
at Parser.emit (node:events:514:28)
at Parser._write (/usr/lib/node_modules/pm2/node_modules/amp/lib/stream.js:91:16)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
Solution:
Make sure you have an ecosystem.config.js
(or ecosystem.config.cjs
) file at the root of the project - with the "script"
pointing to your application's entrypoint.
TypeScript compilation errors¶
If you are seeing TypeScript compilation errors such as the example below, please read the TypeScript compilation errors article, as it has important more information on how to fix those.
src/app.config.ts(3,28): error TS2307: Cannot find module '@colyseus/playground' or its corresponding type declarations.
src/app.config.ts(25,34): error TS7006: Parameter 'req' implicitly has an 'any' type.
src/app.config.ts(25,39): error TS7006: Parameter 'res' implicitly has an 'any' type.
...
Error Output:
================
post-deploy hook failed
Deploy failed
Deploy failed with exit code: 1