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
What you expected to see, versus what you actually saw
We expected to see a non-hoisted npm package updated in its npm workspace
Instead we saw a partial update, child dependencies hoisting, and old package-lock.json entries remaining
Updating express-validator from 6.15.0 to 7.0.1.
Our current version of express-validator starts off in app/node_modules
Is there an existing issue for this?
Package ecosystem
npm
Package manager version
npm 9.6.2
Language version
Node.js 18.14.0
Manifest location and content before the Dependabot update
Repository: https://github.com/alphagov/govuk-frontend
/package-lock.json
/package.json
With npm workspaces:
That have
package.json
files:/app/package.json
/docs/examples/webpack/package.json
/shared/config/package.json
/shared/helpers/package.json
/shared/lib/package.json
/shared/tasks/package.json
dependabot.yml content
https://github.com/alphagov/govuk-frontend/blob/main/.github/dependabot.yml
Updated dependency
Bumps express-validator from 6.15.0 to 7.0.1.
What you expected to see, versus what you actually saw
We expected to see a non-hoisted npm package updated in its npm workspace
Instead we saw a partial update, child dependencies hoisting, and old package-lock.json entries remaining
Updating
express-validator
from 6.15.0 to 7.0.1.Our current version of
express-validator
starts off inapp/node_modules
Before the update our package-lock.json shows it isn't hoisted:
Maybe it's not hoisted due to peerDependency issues in
express-validator
dependencyvalidator
?But in the Dependabot PR we can see the following changes to package-lock.json
Thankfully we have a
postinstall
script which runs:npm ls --depth=0
Which reveals the old
express-validator@6.15.0
is still set somewhere:Taking an extract from the tree view we can see it again here:
☝️ This is the problem
The version is bumped, a child dependency is hoisted, but the workspace node_modules entry remains
Native package manager behavior
The native package manager npm also has issues updating this package
But we have found some workarounds that Dependabot could also use?
These are still issues in
npm@9.6.5
❌ Package not updated but is hoisted
npm install express-validator@7.0.1 --workspace app --save
✅ Package updated and is hoisted
✅ Package removed, updated and is hoisted
Where that last workaround shows that npm correctly hoists
express-validator
tonode_modules
:Images of the diff or a link to the PR, issue, or logs
No response
Smallest manifest that reproduces the issue
No response
The text was updated successfully, but these errors were encountered: