aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/install/update-package-json.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install/update-package-json.js')
-rw-r--r--deps/npm/lib/install/update-package-json.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/deps/npm/lib/install/update-package-json.js b/deps/npm/lib/install/update-package-json.js
index eee530c3cd..14339d0012 100644
--- a/deps/npm/lib/install/update-package-json.js
+++ b/deps/npm/lib/install/update-package-json.js
@@ -20,20 +20,24 @@ module.exports = function (mod, buildpath, next) {
pkg._requiredBy =
mod.requiredBy
.map(function (req) {
- if (req.package.devDependencies[name] && !req.package.dependencies[name]) {
+ if (
+ req.package.devDependencies &&
+ req.package.devDependencies[name] &&
+ !req.package.dependencies[name]
+ ) {
return '#DEV:' + req.location
} else {
return req.location
}
})
.concat(mod.userRequired ? ['#USER'] : [])
- .concat(mod.existing ? ['#EXISTING'] : [])
.sort()
pkg._location = mod.location
pkg._phantomChildren = {}
Object.keys(mod.phantomChildren).sort().forEach(function (name) {
pkg._phantomChildren[name] = mod.phantomChildren[name].package.version
})
+ pkg._inBundle = !!mod.fromBundle
// sort keys that are known safe to sort to produce more consistent output
sortKeys.forEach(function (key) {
@@ -42,5 +46,8 @@ module.exports = function (mod, buildpath, next) {
var data = JSON.stringify(sortedObject(pkg), null, 2) + '\n'
- writeFileAtomic(path.resolve(buildpath, 'package.json'), data, next)
+ writeFileAtomic(path.resolve(buildpath, 'package.json'), data, {
+ // We really don't need this guarantee, and fsyncing here is super slow.
+ fsync: false
+ }, next)
}