npm / npm/cli

[BUG] npm update does not work with scoped private packages

Open
#3,004 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm trying to update a scoped private package using the following command:

npm update @snappykraken/ui-elements

But nothing happens. I can see the following lines in the debug output (--dd):

npm http fetch GET 404 https://registry.npmjs.org/@snappykraken%2fui-elements 2473ms
npm http fetch GET 404 https://registry.npmjs.org/@snappykraken%2fui-elements 1048ms

I guess it should use https://www.npmjs.com/package/@snappykraken/ui-elements instead of https://registry.npmjs.org/@snappykraken%2fui-elements.

Current Behavior:

The latest version of a library doesn't get into node_modules and it is also not changed in package-lock.json.

Expected Behavior:

Both node_modules folder and package-lock.json file should get updated.

Steps To Reproduce:
  1. Install a scoped package with npm install
  2. Wait until a new version is released (or do it yourself with your own library)
  3. Try to update this package with npm update
Environment:

OS: Manjaro Linux (kernel 5.10.23)
Node: v15.11.0
npm: 7.7.5

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 reproducing the reported npm update @snappykraken/ui-elements flow with a scoped private package and inspect how the npm CLI resolves its registry URL. Compare the result with the expected registry configuration, then verify that both node_modules and package-lock.json update after the package version changes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.