Skip to content

Commit

Permalink
raise an error to specify the that the lock file needs to be regenera…
Browse files Browse the repository at this point in the history
…ted due to dependency shrinkwrap object being empty
  • Loading branch information
Danielle Adams committed Apr 1, 2020
1 parent 110457a commit 7f16d6d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/install/inflate-shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const childPath = require('../utils/child-path.js')
const createChild = require('./node.js').create
let fetchPackageMetadata
const inflateBundled = require('./inflate-bundled.js')
const errorHandler = require('../utils/error-handler.js')
const moduleName = require('../utils/module-name.js')
const normalizePackageData = require('normalize-package-data')
const npm = require('../npm.js')
Expand Down Expand Up @@ -52,6 +53,14 @@ function inflateShrinkwrap (topPath, tree, swdeps, opts) {
const sw = swdeps[name]
const dependencies = sw.dependencies || {}
const requested = realizeShrinkwrapSpecifier(name, sw, topPath)

// if (Object.keys(sw).length === 0) {
// let message = `Object for dependency "${name}" is empty.\n`
// message += 'Something went wrong. Regenerate the package-lock.json with "npm install".\n'
// message += 'If using a shrinkwrap, regenerate with "npm shrinkwrap".'
// return errorHandler(message)
// }

return inflatableChild(
onDisk[name], name, topPath, tree, sw, requested, opts
).then((child) => {
Expand Down

0 comments on commit 7f16d6d

Please sign in to comment.