(@aws-cdk/aws-lambda-nodejs): fails on Windows when using pnpm
#27654
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
os/windows
Related specifically to Windows behavior
p2
Describe the bug
I've installed
pnpm
on Windows using the following method from the docs https://pnpm.io/installation#on-windowsthis makes the command
pnpm
work in both Command Prompt and PowerShell. However the following line of code appends.cmd
to thepnpm
commandaws-cdk/packages/aws-cdk-lib/aws-lambda-nodejs/lib/package-manager.ts
Line 73 in 10b3221
Expected Behavior
for bundling to pass without errors
Current Behavior
Instead of
pnpm.cmd
, it should just invokepnpm
. Otherwise, when runningcdk deploy
with a node js lambda usingpnpm
as a package manager, you get the follow error during bundlingReproduction Steps
I've tried reproducing this in an isolated project but it didn't trigger the error, so I'm struggling to find out what scenario triggers
pnpm.cmd
to be fed to the shellPossible Solution
Instead of
pnpm.cmd
,runBinCommand
should just invokepnpm
when on WindowsAdditional Information/Context
No response
CDK CLI Version
2.102.0
Framework Version
2.102.0
Node.js Version
v18.18.0
OS
Windows 11
Language
TypeScript
Language Version
5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: