-
Notifications
You must be signed in to change notification settings - Fork 822
Description
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
v18.7.0
Amplify CLI Version
10.6.2
What operating system are you using?
macOS 13.1
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
i have a monorepo using yarn 1.22.19 workspaces in which i have installed amplify. i also have a custom resource as a part of my amplify setup defined via a cdk-stack.ts file. when i try to run amplify push, i get the following error:
✖ There was an error pulling the backend environment main.
🛑 TypeScript executable not found.
this error is generated from the utils/build-custom-resources.ts file: https://github.com/aws-amplify/amplify-cli/blob/dev/packages/amplify-category-custom/src/utils/build-custom-resources.ts#L89-L92, and it occurs because that file is manually attempting to find the tsc executable within the backend/custom/{CustomResourceName}/node_modules/.bin directory:
const targetDir = path.resolve(path.join(pathManager.getBackendDirPath(), categoryName, resource.resourceName));
// ...
const localTscExecutablePath = path.join(targetDir, 'node_modules', '.bin', 'tsc');so if the tsc executable has been hoisted to the workspace route, that path fails the fs.existsSync(localTscExecutablePath) check and the process throws an error.
Expected behavior
i expected the buildResource util to work even if dependencies have been hoisted.
Reproduction steps
- create a yarn workspace and a directory to serve as the amplify root (e.g.
/webin my example) and runamplify initin that root directory - add a custom resource to your amplify install
- run yarn from the workspace root and confirm that the
tscexecutable exists in the workspace root’snode_modules/.bin/directory but not in the custom resource’snode_modules/.bin/directory - run
amplify push
Project Identifier
Project Identifier: 4cce2c1871372609297d98c2261bc65e
Log output
2023-01-25T14:49:46.766Z|info : amplify-provider-awscloudformation.aws-cfn.describeStack.cfn.describeStacks([{"StackName":"[***]rmation:us-[***]st-[***]08:stack/[***]ify-[*****]ry-[***]in-[***]29-[*****]kStripe-[*****]CK70/[*****]a0-[***]c7-[***]ec-[***]51-[******]5f"}])
2023-01-25T14:49:46.767Z|info : amplify-provider-awscloudformation.aws-cfn.describeStack.cfn.describeStacks([{"StackName":"[***]rmation:us-[***]st-[***]08:stack/[***]ify-[*****]ry-[***]in-[***]29-[******]ors-[*****]F4S/[****]e30-[***]ef-[***]ec-[***]66-[*****]7ad"}])
2023-01-25T14:49:47.898Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]ify-[***]json","Bucket":"[***]ify-[*****]ry-[***]in-[***]29-[*****]nt"}])
2023-01-25T14:49:54.707Z|error : TypeScript executable not found.
MissingOverridesInstallationRequirementsError: TypeScript executable not found.
Additional information
No response
Before submitting, please confirm:
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.