npm / npm/cli

[BUG] npm 9 does not handle workspace versioning done outside of `npm version`

Open
#5,967 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Priority 1 Release 9.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

Currently a lerna monorepo that is using npm < 9 workspaces under the hood running

npx lerna version patch

would resolve as expected w/ bumping the versions of the packages. However running the same sequence generates this below
Screen Shot 2022-12-14 at 12 36 00 PM

Expected Behavior

Once the above commands are run it should continue with lerna's process of bumping the package version and pushing of git tags

Steps To Reproduce
  1. Clone this repo https://github.com/rxmarbles/lerna-lockfile-v3-bug-repro
  2. Run npm install
  3. Run npx lerna version patch
  4. It should generate the issue
    Screen Shot 2022-12-14 at 12 36 00 PM
Environment
  • npm: 9.2.
  • Node.js: 18.12.1
  • OS Name:
  • System Model Name: Macbook Pro
  • npm config:
; "user" config from /Users/rmarkins/.npmrc

//registry.npmjs.org/:_authToken = (protected) 

; "cli" config from command line options

location = "project" 

; node bin location = /Users/rmarkins/Library/Application Support/fnm/node-versions/v18.12.1/installation/bin/node
; node version = v18.12.1
; npm local prefix = /Users/rmarkins/Projects/personal/lerna-lockfile-v3-bug-repro
; npm version = 9.2.0
; cwd = /Users/rmarkins/Projects/personal/lerna-lockfile-v3-bug-repro
; HOME = /Users/rmarkins
; Run `npm config ls -l` to show all defaults.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by cloning the linked lerna-lockfile-v3-bug-repro repository, running npm install, and reproducing the failure with npx lerna version patch under npm 9.2.0 and Node.js 18.12.1. Trace the npm workspace versioning path involved in that command and compare its behavior with npm versions before 9. Done means Lerna can bump package versions and continue pushing git tags as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.