[BUG] binary not exposed with npm updating missing package globally
Nobody has claimed this yet.
- 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
The documentation for npm update states that it would install missing packages.
When I update package X in global scope, the process returns with exit code 0 and
; npm update --global X
changed 1 package in 635ms
To me this would indicate all necessary steps have been taken in order to run the latest version of the package.
However, The binary that is available when running npm install --global X, however, is not known to my shell.
For this to happen I have to run npm install --global X once. Is that intended behaviour?
Expected Behavior
If the user has to install a package in global scope in order to have access to the binary the package exposes, then I would expect the update command to tell me that the package was missing and therefore the command line script to not have been installed.
Steps To Reproduce
- with node 24.10.0 and npm 11.7.0
- with a package
Xthat exposes a command line scriptYin .bin - Run
npm uninstall --global X - Run
npm update --global X - attempt to call cli script
Y - the command is not found
- Run
npm install --global X - call
Y
Environment
- npm: 11.7.0
- Node.js: 24.10.0
- OS Name: OSX 15.7.2
- System Model Name:
- npm config:
; node bin location = /Users/XXX/.asdf/installs/nodejs/24.10.0/bin/node
; node version = v24.10.0
; npm local prefix = /Users/XXX
; npm version = 11.7.0
; cwd = /Users/XXX
; HOME = /Users/XXX
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the global workflow with npm 11.7.0: uninstall package X, run npm update --global X, and compare the result with npm install --global X. Trace the global update and .bin handling, then verify that the exposed script Y is available after the intended command and that missing packages are reported consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100