Skip to content

The prepare step inadvertently triggers a full npm install #1068

@Avaq

Description

@Avaq

Running npm version without --package-lock-only causes a full npm install to happen just to update the package lock file. In my CI, where the release script runs in an isolated container, this causes a cascade of problems:

  1. npm version triggers npm install (causing 2000 packages to be downloaded unnecessarily)
  2. npm install triggers npm prepare
  3. npm prepare installs Husky hooks
  4. git push triggers those Husky hooks to run my test suite (which takes 10+ minutes)
  5. tests fail because the release-container is not set up for them
  6. the semantic release has failed because the git push was prevented by Husky

I could solve some of the issues in any steps along the way, but the root of the problem lies in the npm install that gets executed by the semantic-release/npm prepare step.

All that's needed to fix it is the addition of the --package-lock-only flag in the npm version command:

["version", version, "--userconfig", npmrc, "--no-git-tag-version", "--allow-same-version"],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions