Skip to content

Commit c024dca

Browse files
author
Danielle Adams
committed
raise an error to specify the that the lock file needs to be regenerated due to dependency shrinkwrap object being empty
1 parent 9297596 commit c024dca

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/install/inflate-shrinkwrap.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const childPath = require('../utils/child-path.js')
77
const createChild = require('./node.js').create
88
let fetchPackageMetadata
99
const inflateBundled = require('./inflate-bundled.js')
10+
const errorHandler = require('../utils/error-handler.js')
1011
const moduleName = require('../utils/module-name.js')
1112
const normalizePackageData = require('normalize-package-data')
1213
const npm = require('../npm.js')
@@ -52,6 +53,14 @@ function inflateShrinkwrap (topPath, tree, swdeps, opts) {
5253
const sw = swdeps[name]
5354
const dependencies = sw.dependencies || {}
5455
const requested = realizeShrinkwrapSpecifier(name, sw, topPath)
56+
57+
// if (Object.keys(sw).length === 0) {
58+
// let message = `Object for dependency "${name}" is empty.\n`
59+
// message += 'Something went wrong. Regenerate the package-lock.json with "npm install".\n'
60+
// message += 'If using a shrinkwrap, regenerate with "npm shrinkwrap".'
61+
// return errorHandler(message)
62+
// }
63+
5564
return inflatableChild(
5665
onDisk[name], name, topPath, tree, sw, requested, opts
5766
).then((child) => {

0 commit comments

Comments
 (0)