diff --git a/lib/config/core.js b/lib/config/core.js index b9851f98d0e0c..36605555ff77a 100644 --- a/lib/config/core.js +++ b/lib/config/core.js @@ -218,7 +218,6 @@ function Conf (base) { Conf.prototype.loadPrefix = require('./load-prefix.js') Conf.prototype.loadCAFile = require('./load-cafile.js') -Conf.prototype.loadUid = require('./load-uid.js') Conf.prototype.setUser = require('./set-user.js') Conf.prototype.getCredentialsByURI = require('./get-credentials-by-uri.js') Conf.prototype.setCredentialsByURI = require('./set-credentials-by-uri.js') @@ -227,11 +226,8 @@ Conf.prototype.clearCredentialsByURI = require('./clear-credentials-by-uri.js') Conf.prototype.loadExtras = function (cb) { this.setUser(function (er) { if (er) return cb(er) - this.loadUid(function (er) { - if (er) return cb(er) - // Without prefix, nothing will ever work - mkdirp(this.prefix, cb) - }.bind(this)) + // Without prefix, nothing will ever work + mkdirp(this.prefix, cb) }.bind(this)) } diff --git a/lib/config/load-uid.js b/lib/config/load-uid.js deleted file mode 100644 index 859eac7494bc7..0000000000000 --- a/lib/config/load-uid.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = loadUid - -var getUid = require('uid-number') - -// Call in the context of a npmconf object - -function loadUid (cb) { - // if we're not in unsafe-perm mode, then figure out who - // to run stuff as. Do this first, to support `npm update npm -g` - if (!this.get('unsafe-perm')) { - getUid(this.get('user'), this.get('group'), cb) - } else { - process.nextTick(cb) - } -} diff --git a/lib/utils/error-message.js b/lib/utils/error-message.js index ea8b05938c108..7835a1cdfcfa2 100644 --- a/lib/utils/error-message.js +++ b/lib/utils/error-message.js @@ -72,6 +72,20 @@ function errorMessage (er) { } break + case 'EUIDLOOKUP': + short.push(['lifecycle', er.message]) + detail.push([ + '', + [ + '', + 'Failed to look up the user/group for running scripts.', + '', + 'Try again with a different --user or --group settings, or', + 'run with --unsafe-perm to execute scripts as root.' + ].join('\n') + ]) + break + case 'ELIFECYCLE': short.push(['', er.message]) detail.push([