Ts-node:permission denied while deploy a node.js application with TypeScript

The error I received. How can I solve this problem?

Hi there,

Here’s a community thread that discusses the same issue: https://community.render.com/t/sh1-ts-node-permission-denied/9077.

If that doesn’t help, let us know and we will take a closer look.


Render Support Engineer, MT (UTC-6)

Hi, SourLemon, the problem is that the render environment is not seeing your ts-node.

now do this
on your codebasa delete and resinstall nodemodules again like this rm -rf node_modules
now install debug with npm install debug

then add a prestart script to your package.json

the prestart script should point to ts-node binary and give it an executable permision like this
chmod +x node_modules/.bin/ts-node.

your start script should be like this

“prestart”: “chmod +x node_modules/.bin/ts-node”,
“start”: “ts-node index.ts”,

now redeploy again, this should solve your problem.

thank you