Project: appceleratorstudio
Issue TISTUD-6786: Studio installs of global npm packages modifies permissions of .npm folder
h2. problem When I install a node.js module globally via Studio updates (titanium cli for example), it changes the permissions of my .npm folder such that I can no longer do npm installs of any kind without {{sudo}}. Essentially the folder and all files contained within get {{chown}}'ed to {{root}}. This is detailed in this post: https://coderwall.com/p/dxmfpg. The difference between this situation and that link is that this still occurs even if I already have a .npm folder. h2. reproduce # Open Appc Studio # request Appcelerator updates, making sure that it will include titanium cli (rollback your globally installed titanium module if need be) # Install the titanium cli update # attempt to do {{npm install commander}} any where at the CLI (it could be any module on npm) # you should get error like the following {code} npm ERR! Error: EACCES, mkdir '/Users/tlukasavage/.npm/commander/2.3.0' npm ERR! { [Error: EACCES, mkdir '/Users/tlukasavage/.npm/commander/2.3.0'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/Users/tlukasavage/.npm/commander/2.3.0' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Darwin 13.3.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "commander" npm ERR! cwd /Users/tlukasavage npm ERR! node -v v0.10.29 npm ERR! npm -v 1.4.14 npm ERR! path /Users/tlukasavage/.npm/commander/2.3.0 npm ERR! code EACCES npm ERR! errno 3 npm ERR! stack Error: EACCES, mkdir '/Users/tlukasavage/.npm/commander/2.3.0' npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/tlukasavage/npm-debug.log npm ERR! not ok code 0 {code} To workaround this issue, you can do the following: {{sudo chown -R USERNAME ~/.npm}} After which you can do npm installs again without sudo
Story points: 5