diff --git a/aws_lambda_builders/workflows/nodejs_npm/actions.py b/aws_lambda_builders/workflows/nodejs_npm/actions.py index f6d76e0f4..de745cdc7 100644 --- a/aws_lambda_builders/workflows/nodejs_npm/actions.py +++ b/aws_lambda_builders/workflows/nodejs_npm/actions.py @@ -111,7 +111,7 @@ def execute(self): try: LOG.debug("NODEJS installing production dependencies in: %s", self.install_dir) - command = ["install", "-q", "--no-audit", "--no-save", "--unsafe-perm", "--production"] + command = ["install", "-q", "--no-audit", "--no-save", "--unsafe-perm", "--omit=dev"] self.subprocess_npm.run(command, cwd=self.install_dir) except NpmExecutionError as ex: @@ -140,7 +140,7 @@ def execute(self): "--no-audit", "--no-save", "--unsafe-perm", - "--production", + "--omit=dev", "--no-package-lock", "--install-links", ] diff --git a/aws_lambda_builders/workflows/nodejs_npm_esbuild/DESIGN.md b/aws_lambda_builders/workflows/nodejs_npm_esbuild/DESIGN.md index 66f37faee..da4b77d62 100644 --- a/aws_lambda_builders/workflows/nodejs_npm_esbuild/DESIGN.md +++ b/aws_lambda_builders/workflows/nodejs_npm_esbuild/DESIGN.md @@ -26,7 +26,7 @@ operation is designed to be faster than installing dependencies using `npm insta in automated CI environments. If the directory does not contain lockfiles, but contains `package.json`, -execute [`npm install --production`] to download production dependencies. +execute [`npm install --omit=dev`] to download production dependencies. #### Step 2: bundle the main Lambda file diff --git a/tests/unit/workflows/nodejs_npm/test_actions.py b/tests/unit/workflows/nodejs_npm/test_actions.py index ca33237f5..2592944ac 100644 --- a/tests/unit/workflows/nodejs_npm/test_actions.py +++ b/tests/unit/workflows/nodejs_npm/test_actions.py @@ -67,7 +67,7 @@ def test_installs_npm_production_dependencies_for_npm_project(self, SubprocessNp action.execute() - expected_args = ["install", "-q", "--no-audit", "--no-save", "--unsafe-perm", "--production"] + expected_args = ["install", "-q", "--no-audit", "--no-save", "--unsafe-perm", "--omit=dev"] subprocess_npm.run.assert_called_with(expected_args, cwd="artifacts")