amplify:<function-name>
scripts that install devdependencies for build are installing production dependencies due to NODE_ENV=production
#11717
Labels
bug
Something isn't working
functions
Issues tied to the functions category
p2
pending-release
Code has been merged but pending release
How did you install the Amplify CLI?
pnpm
If applicable, what version of Node.js are you using?
18
Amplify CLI Version
10.6.0
What operating system are you using?
mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
n/a
Describe the bug
When building an Amplify project such as https://github.com/aws-amplify/docs which contain a build step (as described in the documentation), push/publish attempts will fail if that npm script relies on installing devDependencies (e.g.
yarn install
) to build TypeScript.This appears to have been caused by https://github.com/aws-amplify/amplify-cli/pull/11509/files#diff-3bc68c769179efb36682df30f333763c03aa2aae3a1d04c80790846419430514R5
To workaround the issue change
yarn install
toyarn install --production=false
in the function's npm script (i.e.amplify:<function-name>
)Expected behavior
--production=false
flagsrc/
and build without further configuration)build
npm scriptmock
npm scriptrelated:
amplify push
happens. #7183Reproduction steps
amplify init -y
amplify push -y
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: