{"action":"closed","issue":{"url":"https://api.github.com/repos/npm/npm/issues/5034","labels_url":"https://api.github.com/repos/npm/npm/issues/5034/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/5034/comments","events_url":"https://api.github.com/repos/npm/npm/issues/5034/events","html_url":"https://github.com/npm/npm/issues/5034","id":31124289,"number":5034,"title":"npm config get user returns 495 (for root account)","user":{"login":"smartmouse","id":4519627,"avatar_url":"https://avatars.githubusercontent.com/u/4519627?v=3","gravatar_id":"","url":"https://api.github.com/users/smartmouse","html_url":"https://github.com/smartmouse","followers_url":"https://api.github.com/users/smartmouse/followers","following_url":"https://api.github.com/users/smartmouse/following{/other_user}","gists_url":"https://api.github.com/users/smartmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/smartmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartmouse/subscriptions","organizations_url":"https://api.github.com/users/smartmouse/orgs","repos_url":"https://api.github.com/users/smartmouse/repos","events_url":"https://api.github.com/users/smartmouse/events{/privacy}","received_events_url":"https://api.github.com/users/smartmouse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/support","name":"support","color":"FF91AF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-04-09T01:57:00Z","updated_at":"2015-01-31T02:15:33Z","closed_at":"2015-01-31T02:15:33Z","body":"Hi I get an error when we do npm install in a root account\r\n\r\nThe cause is due to npm config get user is returning 495 instead of root.\r\nWe  did not configure or set up  any npm config, this is a brand new machine.\r\n\r\nthis is in the builderror.log\r\n```\r\ngyp ERR! configure error \r\ngyp ERR! stack Error: Command failed: Traceback (most recent call last):\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/site.py\", line 556, in <module>\r\ngyp ERR! stack     main()\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/site.py\", line 538, in main\r\ngyp ERR! stack     known_paths = addusersitepackages(known_paths)\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/site.py\", line 266, in addusersitepackages\r\ngyp ERR! stack     user_site = getusersitepackages()\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/site.py\", line 241, in getusersitepackages\r\ngyp ERR! stack     user_base = getuserbase() # this will also set USER_BASE\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/site.py\", line 231, in getuserbase\r\ngyp ERR! stack     USER_BASE = get_config_var('userbase')\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/sysconfig.py\", line 516, in get_config_var\r\ngyp ERR! stack     return get_config_vars().get(name)\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/sysconfig.py\", line 473, in get_config_vars\r\ngyp ERR! stack     _CONFIG_VARS['userbase'] = _getuserbase()\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/sysconfig.py\", line 187, in _getuserbase\r\ngyp ERR! stack     return env_base if env_base else joinuser(\"~\", \".local\")\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/sysconfig.py\", line 173, in joinuser\r\ngyp ERR! stack     return os.path.expanduser(os.path.join(*args))\r\ngyp ERR! stack   File \"/usr/lib64/python2.7/posixpath.py\", line 269, in expanduser\r\ngyp ERR! stack     userhome = pwd.getpwuid(os.getuid()).pw_dir\r\ngyp ERR! stack KeyError: 'getpwuid(): uid not found: 495'\r\ngyp ERR! stack \r\ngyp ERR! stack     at ChildProcess.exithandler (child_process.js:637:15)\r\ngyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)\r\ngyp ERR! stack     at maybeClose (child_process.js:743:16)\r\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:5)\r\ngyp ERR! System Linux 3.10.0-110.el7.ppc64\r\ngyp ERR! command \"node\" \"/root/IBMSVT32/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\r\ngyp ERR! cwd /root/jsteamrepo/MongoDBTest/reddit/node_modules/mongodb/node_modules/bson\r\ngyp ERR! node -v v0.10.26\r\ngyp ERR! node-gyp -v v0.12.2\r\ngyp ERR! not ok \r\n```\r\n\r\nTo fix this , I have to do npm config set user root\r\nand npm config set username root\r\nMy question is: is this as default behavior or this is a bug?\r\n\r\nNot sure why there is user 495 or where does it pick up ? could it be some random user id assigned if nothing has been setup?\r\n\r\nThank you so much in advance.\r\nI have attached the .config folder images\r\n![config](https://cloud.githubusercontent.com/assets/4519627/2651334/13cbfcfe-bf8a-11e3-964d-c65f68912904.gif)\r\n![directory](https://cloud.githubusercontent.com/assets/4519627/2651335/1493b230-bf8a-11e3-8b80-958a582dc3eb.gif)\r\n"}}