-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps
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/XXXMetadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps