Skip to content

Commit

Permalink
Only update package-lock.json when running changeset version script (
Browse files Browse the repository at this point in the history
…#2506)

#2489 broke the `Release` CI with an error that `patch-package`
couldn't be found when running `changeset-version.js`.

It looks like the `npm install` script in `changeset-version.js` is
only installing production dependencies. Moving `patch-package` to
`dependencies` leads to another error that `ink` cannot be found to
apply the patch to.

However, the only reason we run `npm install` here is to update
`package-lock.json`, so we don't need to be running `postinstall`
scripts. Therefore, this PR adds the `--package-lock-only` flag.
See https://docs.npmjs.com/cli/v9/commands/npm-install.
  • Loading branch information
mrbbot authored Jan 6, 2023
1 parent 6b7ebc8 commit 6d6e868
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/changeset-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const { execSync } = require("node:child_process");
// This is a workaround until this is handled automatically by `changeset version`.
// See https://github.com/changesets/changesets/issues/421.
execSync("npx changeset version");
execSync("npm install");
execSync("npm install --package-lock-only");

0 comments on commit 6d6e868

Please sign in to comment.