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

numeric password and trim #1525

Closed
kapouer opened this issue Oct 10, 2011 · 0 comments
Closed

numeric password and trim #1525

kapouer opened this issue Oct 10, 2011 · 0 comments

Comments

@kapouer
Copy link
Contributor

kapouer commented Oct 10, 2011

I added a user with a digits-only password .
It got converted to an integer, somehow, so trim() doesn't exist.
Fix is obvious : (password || "").toString().trim()

info it worked if it ends with ok
verbose cli [ 'node', '/usr/bin/npm', 'adduser' ]
info using npm@1.0.94
info using node@v0.4.12
verbose config file /home/dev/.npmrc
verbose config file /usr/etc/npmrc
verbose config file /usr/share/npm/npmrc
ERR! TypeError: Object 123456 has no method 'trim'
ERR! at Object.adduser (/usr/share/npm/lib/utils/npm-registry-client/adduser.js:22:31)
ERR! at /usr/share/npm/lib/adduser.js:40:16
ERR! at go (/usr/share/npm/lib/utils/promise-chain.js:20:19)
ERR! at /usr/share/npm/lib/utils/promise-chain.js:33:13
ERR! at ReadStream.D (/usr/share/npm/lib/utils/prompt.js:38:7)
ERR! at ReadStream.emit (events.js:64:17)
ERR! at ReadStream._onReadable (net.js:667:31)
ERR! at IOWatcher.onReadable as callback
ERR! Report this entire log at:
ERR! http://github.com/isaacs/npm/issues
ERR! or email it to:
ERR! npm-@googlegroups.com
ERR!
ERR! System Linux 3.1.0-rc7
ERR! command "node" "/usr/bin/npm" "adduser"
ERR! cwd /home/dev
ERR! node -v v0.4.12
ERR! npm -v 1.0.94
ERR! type undefined_method
ERR! arguments [ 'trim', 123456 ]
verbose exit [ 1, true ]

@isaacs isaacs closed this as completed in 80a96e2 Oct 10, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants