Deployment failure: `sh: 1: tsc: Permission denied`
Describe the Issue:
When using NodeJS 18 I can reproduce a consistent failure to deploy with a brand new function.
Repro steps:
doctl serverless init test --language ts
<change runtime to nodejs:18>
doctl serverless deploy test
doctl serverless deploy test --remote-build
> build
> tsc -b
sh: 1: tsc: Permission denied
It specifically happens when building locally then building remotely. If I change my NPM build command to chmod +x node_modules/.bin/tsc && tsc -b or npm ci && tsc -b it will work properly. If I delete the node_modules folder after building locally it works again. It appears to only happen with NodeJS 18, not default/14.
My wild theory is that doctl is uploading my local node_modules folder and attempting to run that on the server. I'm on a Windows machine so the tsc script doesn't have the execute permission that Unix systems require.
Environment:
- doctl version: 1.119.1-release fdec25bc
- OS: Windows 10 22H2
- Installation method: winget
Hey I ran into this too! (1.120.0-release via scoop)
Thanks for the clues to getting past this. Deleting node_modules directory resolved it for me.