You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have an unexpected behaviour between peerDependencies, peerDependenciesMeta and devDependencies.
I have a library with a package.json with a peerDependacy (example lodash) :
"peerDependencies": {
"lodash": "^4.17.21"
},
"peerDependenciesMeta": {
"lodash": {
"optional": true
}
}
When I run npm install --omit-dev, lodash is not installed (correct behavior)
Now I also add lodash as a devDependancy since I want to use it in my unit tests :
"devDependencies": {
"lodash": "^4.17.21"
},
Now, when I run npm install --omit-dev, lodash package is installed (wrong behavior)
Tried with npm 9.8.1, and 10.8.1
Issue happen with any library.
Any projet who has 'lodash' as a devDependancy and use my library will have lodash installed in production
Can you fix this issue ?
Beta Was this translation helpful? Give feedback.
All reactions