Skip to content

shrinkwrap: no need to read package.json when read shrinkwrap #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/install/read-shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function readShrinkwrap (child, next) {
// Don't read non-root lockfiles
child.isTop && maybeReadFile('package-lock.json', child),
child.isTop && maybeReadFile('package.json', child),
(shrinkwrap, lockfile, pkgJson) => {
(shrinkwrap, lockfile) => {
if (shrinkwrap && lockfile) {
log.warn('read-shrinkwrap', 'Ignoring package-lock.json because there is already an npm-shrinkwrap.json. Please use only one of the two.')
}
Expand All @@ -31,7 +31,7 @@ function readShrinkwrap (child, next) {
}
child.package._shrinkwrap = parsed
}
).then(() => next(), next)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a functional change outside the scope of the intent of this PR. It means that a return value will be passed to the next function as the first argument, which would be interpreted as an error. Currently, no return value is being provided, but it makes the code more brittle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I would undo this change.

).then(next, next)
}

function maybeReadFile (name, child) {
Expand Down