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

nx release: please update your lock file with npm install before continuing #26660

Open
1 of 4 tasks
Badisi opened this issue Jun 24, 2024 · 0 comments
Open
1 of 4 tasks

Comments

@Badisi
Copy link

Badisi commented Jun 24, 2024

Current Behavior

Every time I'm running nx release, I'm always getting this error next time I'm doing npm ci:

npm error npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing.

There is a step during nx release that is supposed to "update npm lock" using:

npm install --package-lock-only

but it seems it doesn't work (at least in my case, with independent projects).

Solution

What worked for me, is to use npm install instead of npm install --package-lock-only.

Expected Behavior

After running nx release, we should be able to run npm ci without issue.

GitHub Repo

No response

Steps to Reproduce

My use case is the following:

  • I have a github mono repo
  • When I want to release a package -> I trigger a github action that runs nx release
  • Development keeps going, some changes are made to the project, and pushed
  • At that time, some github actions are automatically triggered to run some tests
    • project is checked out and dependencies are installed with npm ci
    • -> failed because package.json and package-lock.json are no more considered "in sync".

Nx Report

Node   : 18.18.2
OS     : darwin-x64
npm    : 10.8.0

nx (global)    : 19.0.4
nx             : 19.2.0
@nx/js         : 19.2.0
@nx/workspace  : 19.2.0
@nx/devkit     : 19.2.0
@nrwl/tao      : 19.2.0
typescript     : 4.7.4

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants