Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
install: Fix complete brokenness
Browse files Browse the repository at this point in the history
Argh. No more 4am releases. Most (but not ALL) `npm install` use cases
were instant crashers. I apparently THEN went on to run the test suite
against the wrong tree. =( =(

PR-URL: #8922
Fixes #8893
  • Loading branch information
iarna committed Jul 13, 2015
1 parent 9340043 commit f5e19df
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,19 +574,20 @@ Installer.prototype.readLocalPackageData = function (cb) {
return cb(er)
}
if (!currentTree.package) currentTree.package = {}
if (currentTree.package._shrinkwrap) return cb()
fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) {
if (er) return cb()
try {
currentTree.package._shrinkwrap = parseJSON(data)
} catch (ex) {
return cb(ex)
}
return this.loadArgMetadata(cb)
})
self.loadArgMetadata(iferr(cb, function () {
if (currentTree.package._shrinkwrap) return cb()
fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) {
if (er) return cb()
try {
currentTree.package._shrinkwrap = parseJSON(data)
} catch (ex) {
return cb(ex)
}
return cb()
})
}))
}))
}))

}

Installer.prototype.cloneCurrentTreeToIdealTree = function (cb) {
Expand Down

0 comments on commit f5e19df

Please sign in to comment.