Errors running npm 1.1.49 and 1.1.59 #2751

Closed
bog opened this Issue Aug 23, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@bog

bog commented Aug 23, 2012

I'm running into errors running npm bundled with node ≥ 0.8.7 (1.1.49 +) on OS X 10.8. I manage my node installs locally with nvm.

Here is the error (happens if i just run npm by itself as well):

jalavaadita:~ bog$ npm install request
Error: First argument needs to be a number, array or string.
    at new Buffer (buffer.js:236:15)
    at Conf.add (/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/node_modules/npmconf/npmconf.js:250:16)
    at ConfigChain.addString (/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/index.js:244:8)
    at Conf.addFile (/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/node_modules/npmconf/npmconf.js:235:10)
    at fs.readFile (fs.js:176:14)
    at fs.close (/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:92:5)
    at Object.oncomplete (fs.js:297:15)


/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/lib/utils/error-handler.js:49
  var doExit = npm.config.get("_exit")
                          ^
TypeError: Object #<Object> has no method 'get'
    at exit (/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/lib/utils/error-handler.js:49:27)
    at process.errorHandler (/Users/bog/.nvm/v0.8.8/lib/node_modules/npm/lib/utils/error-handler.js:264:3)
    at process.EventEmitter.emit (events.js:115:20)

npm 1.1.48 (bundled with node v0.8.6) works without issue.

@isaacs

This comment has been minimized.

Show comment Hide comment
@isaacs

isaacs Aug 24, 2012

Member

Does it work when you're not using nvm?

Member

isaacs commented Aug 24, 2012

Does it work when you're not using nvm?

@bog

This comment has been minimized.

Show comment Hide comment
@bog

bog Aug 24, 2012

Same issue. Errors now originate from files in /usr/local/lib/node_modules/npm/ so it's definitely the manually installed reference.

bog commented Aug 24, 2012

Same issue. Errors now originate from files in /usr/local/lib/node_modules/npm/ so it's definitely the manually installed reference.

@bog

This comment has been minimized.

Show comment Hide comment
@bog

bog Aug 26, 2012

So, I investigated this a bit further. It's definitely an issue with npmconf (I can move the ticket if you want, but since it's already started…)

The contents of my .npmrc file are:

_password = undefined
_authCrypt = undefined
_auth = undefined

It's definitely an old file. It looks like Conf.add is creating a buffer for auth from that file. Since auth is undefined, the crash ensues. I'm not sure of the history here so I don't feel comfortable submitting a patch that just checks for undefined, but that does fix the issue locally (as does authenticating or removing the .npmrc file).

bog commented Aug 26, 2012

So, I investigated this a bit further. It's definitely an issue with npmconf (I can move the ticket if you want, but since it's already started…)

The contents of my .npmrc file are:

_password = undefined
_authCrypt = undefined
_auth = undefined

It's definitely an old file. It looks like Conf.add is creating a buffer for auth from that file. Since auth is undefined, the crash ensues. I'm not sure of the history here so I don't feel comfortable submitting a patch that just checks for undefined, but that does fix the issue locally (as does authenticating or removing the .npmrc file).

@domenic

This comment has been minimized.

Show comment Hide comment
@domenic

domenic Jun 18, 2013

Member

Not sure what went wrong here, but hopefully a clean install fixed it. Let us know if you're still having this problem.

Member

domenic commented Jun 18, 2013

Not sure what went wrong here, but hopefully a clean install fixed it. Let us know if you're still having this problem.

@domenic domenic closed this Jun 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment