diff options
Diffstat (limited to 'lib/install/inflate-shrinkwrap.js')
-rw-r--r-- | lib/install/inflate-shrinkwrap.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js index 02f7eaedd..8cb75626b 100644 --- a/lib/install/inflate-shrinkwrap.js +++ b/lib/install/inflate-shrinkwrap.js @@ -2,10 +2,10 @@ const BB = require('bluebird') -const addBundled = BB.promisify(require('../fetch-package-metadata.js').addBundled) +let addBundled const childPath = require('../utils/child-path.js') const createChild = require('./node.js').create -const fetchPackageMetadata = BB.promisify(require('../fetch-package-metadata.js')) +let fetchPackageMetadata const inflateBundled = require('./inflate-bundled.js') const moduleName = require('../utils/module-name.js') const normalizePackageData = require('normalize-package-data') @@ -15,6 +15,10 @@ const validate = require('aproba') const path = require('path') module.exports = function (tree, swdeps, opts, finishInflating) { + if (!fetchPackageMetadata) { + fetchPackageMetadata = BB.promisify(require('../fetch-package-metadata.js')) + addBundled = BB.promisify(fetchPackageMetadata.addBundled) + } if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) { return finishInflating() } |