summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install')
-rw-r--r--deps/npm/lib/install/action/finalize.js2
-rw-r--r--deps/npm/lib/install/action/prepare.js4
-rw-r--r--deps/npm/lib/install/inflate-bundled.js4
-rw-r--r--deps/npm/lib/install/inflate-shrinkwrap.js6
4 files changed, 8 insertions, 8 deletions
diff --git a/deps/npm/lib/install/action/finalize.js b/deps/npm/lib/install/action/finalize.js
index ba38e602f8..ded2350dff 100644
--- a/deps/npm/lib/install/action/finalize.js
+++ b/deps/npm/lib/install/action/finalize.js
@@ -90,6 +90,6 @@ module.exports = function (staging, pkg, log) {
module.exports.rollback = function (top, staging, pkg, next) {
const requested = pkg.package._requested || getRequested(pkg)
- if (requested.type === 'directory') return next()
+ if (requested && requested.type === 'directory') return next()
gentlyRm(pkg.realpath, false, top, next)
}
diff --git a/deps/npm/lib/install/action/prepare.js b/deps/npm/lib/install/action/prepare.js
index 771a2a9399..5e4333a5b5 100644
--- a/deps/npm/lib/install/action/prepare.js
+++ b/deps/npm/lib/install/action/prepare.js
@@ -11,8 +11,8 @@ module.exports = function (staging, pkg, log, next) {
// see https://github.com/npm/npm/issues/10074 for details
if (pkg.package && pkg.package.scripts && pkg.package.scripts.prepublish) {
prepublishWarning([
- 'As of npm@5, `prepublish` scripts will run only for `npm publish`.',
- '(In npm@4 and previous versions, it also runs for `npm install`.)',
+ 'As of npm@5, `prepublish` scripts are deprecated.',
+ 'Use `prepare` for build steps and `prepublishOnly` for upload-only.',
'See the deprecation note in `npm help scripts` for more information.'
])
}
diff --git a/deps/npm/lib/install/inflate-bundled.js b/deps/npm/lib/install/inflate-bundled.js
index 70da583df4..66bbb44a33 100644
--- a/deps/npm/lib/install/inflate-bundled.js
+++ b/deps/npm/lib/install/inflate-bundled.js
@@ -1,11 +1,11 @@
'use strict'
-var validate = require('aproba')
+
var childPath = require('../utils/child-path.js')
var reset = require('./node.js').reset
module.exports = function inflateBundled (bundler, parent, children) {
- validate('OOA', arguments)
children.forEach(function (child) {
+ if (child.fromBundle === bundler) return
reset(child)
child.fromBundle = bundler
child.isInLink = bundler.isLink
diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js
index 8cb75626bb..7ad966ea0a 100644
--- a/deps/npm/lib/install/inflate-shrinkwrap.js
+++ b/deps/npm/lib/install/inflate-shrinkwrap.js
@@ -19,13 +19,13 @@ module.exports = function (tree, swdeps, opts, finishInflating) {
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()
- }
if (arguments.length === 3) {
finishInflating = opts
opts = {}
}
+ if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) {
+ return finishInflating()
+ }
tree.loaded = true
return inflateShrinkwrap(tree.path, tree, swdeps, opts).then(
() => finishInflating(),