-
Couldn't load subscription status.
- Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release
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
When using workspaces, having a dev dependency which has one version in root and a different conflicting version inside a workspace folder and running npm ci --omit=devit will ignore dev deps present in the root package.json but install dev dependencies for the child workspaces.
I found an issue relating to it here but it was back in version 7 and has been fixed as well apparently.
Expected Behavior
Using omit=dev should not install dev deps for root or any child workspace
Steps To Reproduce
- Using npm version 9.6.6
- Create a project with a sub folder which is also a workspace in the root package json. Added some dev dependency to the root package json and some different version of the dev dependency to the package json inside the sub folder so that it conflicts and is not hoisted
- Run
npm ci --omit=devfrom root ornpm ci --omit=devfrom inside the sub folder ornpm ci --omit=dev --workspace <package-name-in-package-json-in-subfolder>from either folder - The dev dependency inside subfolder will get installed
Repo with minimum reproducible example: https://github.com/Rayyan98/npm-issue
Environment
- npm: 9.6.6
- Node.js: 18.14.1
- OS Name: Mac OS
- System Model Name: -
- npm config:
; node bin location = /Users/rayyanulhaq/.nvm/versions/node/v18.14.1/bin/node
; node version = v18.14.1
; npm local prefix = /Users/rayyanulhaq/Work/rewaa/simple
; npm version = 9.6.6
; cwd = /Users/rayyanulhaq/Work/rewaa/simple
; HOME = /Users/rayyanulhaq
; Run `npm config ls -l` to show all defaults.```morganney, martinbroede, andrejk-phsa, ImTemporaryHere, tapz and 1 more
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release