claudiajs / claudia

Deploy Node.js projects to AWS Lambda and API Gateway easily
https://claudiajs.com
MIT License
3.8k stars 276 forks source link

Dedupe with "--production" and "--no-optional" flags #225

Closed danielg-cf closed 2 years ago

danielg-cf commented 3 years ago

Unless these flags are set, dedupe re-installs optional dependencies. This issue was confirmed on Node 12, 14, 16 with NPM versions 6.14.12 and 7.14.0.

pkyeck commented 3 years ago

Had the same problem using NPM 7 – worked around this by adding --npm-options="--production" to my claudia update script:

"update": "claudia update --profile xxxxxx --no-optional-dependencies --handler built/index.handler --config claudia.staging.json --quiet --npm-options=\"--production\""

Hopefully this gets merged soon

Biktop commented 3 years ago

To get rid of optional aws-sdk I also added --no-optional flag. Because only --production didn't help me.

--npm-options=\"--production --no-optional\"

gojko commented 2 years ago

thanks, this is now published as v 5.14.0

pkyeck commented 2 years ago

I still have problems with npm 6.14.15 (and a yarn.lock) – optional dependencies make it into the package. anyone else?