Tsc: not found, errno ENOENT

sh: 1: tsc: not found
Aug 26 10:37:32 PM npm ERR! code ELIFECYCLE
Aug 26 10:37:32 PM npm ERR! syscall spawn
Aug 26 10:37:32 PM npm ERR! file sh
Aug 26 10:37:32 PM npm ERR! errno ENOENT
Aug 26 10:37:32 PM npm ERR! server@1.0.0 build: tsc
Aug 26 10:37:32 PM npm ERR! spawn ENOENT
Aug 26 10:37:32 PM npm ERR!
Aug 26 10:37:32 PM npm ERR! Failed at the server@1.0.0 build script.
Aug 26 10:37:32 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Aug 26 10:37:32 PM
Aug 26 10:37:32 PM npm ERR! A complete log of this run can be found in:
Aug 26 10:37:32 PM npm ERR! /opt/render/.cache/_logs/2023-08-26T16_07_32_894Z-debug.log
Aug 26 10:37:32 PM ==> Build failed :disappointed:

I’m deploying node server and got this

I installed tsc in devDependencies
my .env

NODE_ENV = deployment

Hi KhayKhun.

I’m unfamiliar with Node/Typescript, but maybe you can install it globally using npm in Render’s Shell module? Is the TypeScript (tsc) compiler a typical dependency you add to your .env file or install via devDependencies? Hope this helps. :grinning:

1 Like

Is your .env loaded into the Render Dashboard for your app? If not, the deploy process won’t use it, which means the build phase of the deployment runs as $NODE_ENV = "production", which deletes devDependencies, which removes ts-node and renders tsc non-existent.

1 Like

Thanks for replying but
as I’m using free mode, shell is not supported for me by render.com
I’ll figure it out in other ways

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.