-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packaging lambda function failed with the error: tsc: command not found #3377
Comments
I thought this may be a NextJs issue so i created a test app following the steps above with create-react-app. And I have the exact same issue. AppId: dtf5rnawhfgkc |
The solution is to compile the js outside the src folder of the lambda function. Creating the TS lambda's using these instructions solved the problem: aws-amplify/amplify-cli#6398 (comment) |
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Before opening, please confirm:
App Id
d39mjfc3kkuapk
AWS Region
eu-central-1
Amplify Hosting feature
Deployments
Describe the bug
I have an existing amplify app for my dev backend. That env works fine.
If I add a new 'test' amplify env using amplify env add. I cannot deploy it because it fails with the error:
Packaging lambda function failed with the error
Command failed with exit code 127: npm run-script amplify:testHostingFn
sh: tsc: command not found
> [email protected] amplify:testHostingFn
> cd amplify/backend/function/testHostingFn && tsc -p ./tsconfig.json && cd -
Expected behavior
The new test environment should be deployed
Reproduction steps
created next app -ts
created repo on code commit
pushed to code commit
initiated amplify
connected branch to amplify hosting
added amplify REST api & lambda express function
amplify push the BE
created app.ts & ts config etc according to https://docs.amplify.aws/cli/function/build-options/
amplify push
git commit and push - to kick off CICD
error during FE build cos of express already being declared as block scoped variable.
git commit and push - to kick off CICD
*** ALL Good up to now. env is deployed! ***
create test env following the insturctions: https://docs.amplify.aws/cli/teams/overview/#continuous-deployment-and-hosting
create hosting for test branch in amplify console.
Build fails: error:
Packaging lambda function failed with the error
Command failed with exit code 127: npm run-script amplify:testHostingFn
sh: tsc: command not found
Build Settings
No response
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: