#Packaging lambda function failed: tsc: command not found

3 messages · Page 1 of 1 (latest)

rough tundra
#

I have hosting set up for the dev and test branches of my app. My NextJs app is written in typescript and so my lambda functions are written in typescript, I used these instructions for the lambda's: https://docs.amplify.aws/cli/function/build-options/

The git repo is in codecommit with three branches: dev, test & uat

The hosting of dev and test was set up ages ago and works fine.

Today I tried to connect my uat branch to create a new env for my user testers. So, in amplify console, i connect the repo branch uat to the uat amplify backend and it starts to build.

During the build I get this error:

    Command failed with exit code 127: npm run-script amplify:fnHandler
sh: tsc: command not found
> [email protected] amplify:fnHandler
> cd amplify/backend/function/fnHandler && tsc -p ./tsconfig.json && cd -```

Note, re-deploying on my dev hosting still works fine.
#

Any idea what I'm doing wrong?

rough tundra
#

The amplify version on local is 11.0.1 and my lambda package.json contains the dev dependency: ``` "devDependencies": {
"@types/aws-lambda": "^8.10.92",
"typescript": "^4.9.3"
}