How to execute global packages
Emily Wong
I'm trying to start an AWS CDK Project using pnpm v8.0.0 as my package manager. Then, I've followed these steps:
- Installed [email protected] globally:
pnpm install -g aws-cdk - Created a new directory:
mkdir my-dir && cd my-dir - Tried to execute the 'init' command:
pnpm exec cdk init app --language=typescript
However, I've got the following pnpm error: ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Cannot read properties of undefined (reading '/home/user/my-dir')
I've tried to workaround this by installing aws-cdk locally: pnpm init && pnpm install -D aws-cdk and then running the same pnpm exec... command and then I've got a aws-sdk error: cdk init cannot be run in a non-empty directory!
The pnpm docs is clear about exec: Execute a shell command in scope of a project.
My question is: How use pnpm to execute global packages?
Related questions 0 Peer dependencies issue in eslint-config-next (with Typescript) 2 AWS CDK2 Synth Cannot Find Module - NPM Linked Peer Dependency 13 AWS CDK Init for an existing project Related questions 0 Peer dependencies issue in eslint-config-next (with Typescript) 2 AWS CDK2 Synth Cannot Find Module - NPM Linked Peer Dependency 13 AWS CDK Init for an existing project 0 Importing existing CDK Project, Getting issue while performing cdk ls command 6 Why does the typescript aws-cdk init-template include its app in the bin directory and as a binary in package.json? 0 'cdk' is not recognized as an internal or external command 18 AWS CDK -- Cannot find module '@aws-cdk/aws-ec2' 3 How to package dependencies using @aws-cdk/pipelines module construct? Getting error TS2307 1 aws sam local invoke command returns Error: Cannot find module error Load 6 more related questions Show fewer related questions Reset to default