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
I do not expect that this change appears in the lock file:
"dependencies": {
"prisma": "5.14.0"
},
Or I do not expect that after npm install the change get's removed.
Steps To Reproduce
See "Current Behavior"
Please note: The steps to reproduce I have shared is a minimal application. This bug appears in my large application with having lot's of dev dependencies and optional dependencies, but we do not have production dependencies.
Environment
npm: 10.7.0
Node.js: Latest v18 (Also tested latest v22)
OS Name: OSX
System Model Name:
npm config:
; copy and paste output from `npm config ls` here
The text was updated successfully, but these errors were encountered:
I spent some time looking into this issue, and it seems like this is intended behavior for when you install a package. According to a comment, optional dependencies are added to production dependencies to support "previous npm versions that require this behaviour."
I'll still open a PR to see how the project maintainers/engineers feel about changing this since it can come off as confusing to the user.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Lock file is incorrect after updating optional dependency.
Steps to reproduce:
package.json
package-lock.json
`
I want to update prisma to 5.14.0 running:
npm i prisma@^5.14.0 --save-optional
(I also tried
npm i prisma@^5.14.0
andnpm i prisma@latest
, same behaviour)package.json (correct)
package-lock.json (wrong)
Running
npm install
again (correct)Expected Behavior
I do not expect that this change appears in the lock file:
Or I do not expect that after
npm install
the change get's removed.Steps To Reproduce
See "Current Behavior"
Please note: The steps to reproduce I have shared is a minimal application. This bug appears in my large application with having lot's of dev dependencies and optional dependencies, but we do not have production dependencies.
Environment
; copy and paste output from `npm config ls` here
The text was updated successfully, but these errors were encountered: