diff --git a/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts b/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts index 2ef3baa4f0d..baa0c83357f 100644 --- a/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts +++ b/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts @@ -93,17 +93,7 @@ export const buildOverrideDir = async (cwd: string, destDirPath: string): Promis const tsConfigSampleFilePath = path.join(__dirname, '..', '..', 'resources', 'overrides-resource', 'tsconfig.resource.json'); fs.writeFileSync(tsConfigDestFilePath, fs.readFileSync(tsConfigSampleFilePath)); - // get locally installed tsc executable - - const localTscExecutablePath = path.join(cwd, 'node_modules', '.bin', 'tsc'); - - if (!fs.existsSync(localTscExecutablePath)) { - throw new AmplifyError('MissingOverridesInstallationRequirementsError', { - message: 'TypeScript executable not found.', - resolution: 'Please add it as a dev-dependency in the package.json file for this resource.', - }); - } - execa.sync(localTscExecutablePath, [`--project`, `${tsConfigDestFilePath}`], { + execa.sync(packageManager.executable, [`run`, `build`, `--project`, `${tsConfigDestFilePath}`], { cwd: tsConfigDir, stdio: 'pipe', encoding: 'utf-8',