Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to npm ci for reliable builds #135

Merged
merged 2 commits into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/deps/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ func (resolver *NpmResolver) NeedSkipInstallPkgs() bool {
}
}

// InstallPkgs runs command 'npm install' to install node packages
// InstallPkgs runs command 'npm ci' to install node packages,
// using `npm ci` instead of `npm install` to ensure the reproducible builds.
// See https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable
func (resolver *NpmResolver) InstallPkgs() {
cmd := exec.Command("npm", "install")
cmd := exec.Command("npm", "ci")
logger.Log.Println(fmt.Sprintf("Run command: %v, please wait", cmd.String()))
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down