From fe67287306a98e8b400995c9195b933360614d9a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 13 Jul 2018 14:37:56 -0700 Subject: [PATCH] build: move to `npm ci` where possible Recent events (involving a maliciously published version of a popular module's dependency) have reinvigorated my interest in seeing us move to `npm ci` instead of `npm install`. This moves us to `npm ci` where possible in Makefile and vcbuild.bat. PR-URL: https://github.com/nodejs/node/pull/21802 Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Richard Lau Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- Makefile | 5 +++-- vcbuild.bat | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8f378b4c9ddf41..a35d8b34f3f4c6 100644 --- a/Makefile +++ b/Makefile @@ -652,6 +652,7 @@ available-node = \ fi; run-npm-install = $(PWD)/$(NPM) install --production --no-package-lock +run-npm-ci = $(PWD)/$(NPM) ci tools/doc/node_modules/js-yaml/package.json: cd tools/doc && $(call available-node,$(run-npm-install)) @@ -1061,12 +1062,12 @@ lint-md-clean: tools/remark-cli/node_modules: tools/remark-cli/package.json @echo "Markdown linter: installing remark-cli into tools/" - @cd tools/remark-cli && $(call available-node,$(run-npm-install)) + @cd tools/remark-cli && $(call available-node,$(run-npm-ci)) tools/remark-preset-lint-node/node_modules: \ tools/remark-preset-lint-node/package.json @echo "Markdown linter: installing remark-preset-lint-node into tools/" - @cd tools/remark-preset-lint-node && $(call available-node,$(run-npm-install)) + @cd tools/remark-preset-lint-node && $(call available-node,$(run-npm-ci)) .PHONY: lint-md-build lint-md-build: tools/remark-cli/node_modules \ diff --git a/vcbuild.bat b/vcbuild.bat index 368112edf9a02c..fa14e321e6f09d 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -614,12 +614,12 @@ if not defined lint_md_build goto lint-md SETLOCAL echo Markdown linter: installing remark-cli into tools\ cd tools\remark-cli -%npm_exe% install +%npm_exe% ci cd ..\.. if errorlevel 1 goto lint-md-build-failed echo Markdown linter: installing remark-preset-lint-node into tools\ cd tools\remark-preset-lint-node -%npm_exe% install +%npm_exe% ci cd ..\.. if errorlevel 1 goto lint-md-build-failed ENDLOCAL