I have deployed my MERN app and it is working well at Render free service for test purposes but after some small latest revisions on my app (just error message changes and a new condition to an if check), I couldn’t redeploy it with the latest deploy. In the beginning, it gave something like No Enough Disk Space, then started to give “tsc” not found error and now still gives the following errors :
sh: 1: tsc: not found
Jan 23 01:21:13 AM npm ERR! code ELIFECYCLE
Jan 23 01:21:13 AM npm ERR! syscall spawn
Jan 23 01:21:13 AM npm ERR! file sh
Jan 23 01:21:13 AM npm ERR! errno ENOENT
Jan 23 01:21:13 AM npm ERR! firstname.lastname@example.org postinstall: tsc
Jan 23 01:21:13 AM npm ERR! spawn ENOENT
Still having the same problem, tried to change the package JSON script from post-install to npm install && tsc
did not work for me. Planning to delete the web service and try to create it again but on the other hand, I am worried because if it gives the same problem after the delete process, test processes for the current version will also stop.
The problem was from NODE_ENV, I have assigned it to production and it was creating the problem. NODE_ENV = production and hence npm install was not installing the tsc and as a result it couldn’t find the tsc. I removed NODE_ENV production from env and it installed tsc and deployed without a problem.