Uploaded image for project: 'Appcelerator Studio'
  1. Appcelerator Studio
  2. TISTUD-6786

Studio installs of global npm packages modifies permissions of .npm folder

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: Release 3.4.0
    • Component/s: Node, Update
    • Labels:
      None
    • Environment:

      Appcelerator Studio 3.3.0
      node.js 0.10.29
      npm 1.4.14
      Mac OSX 10.9.4

    • Story Points:
      5
    • Sprint:
      2014 Sprint 16 Studio

      Description

      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.

      reproduce

      1. Open Appc Studio
      2. request Appcelerator updates, making sure that it will include titanium cli (rollback your globally installed titanium module if need be)
      3. Install the titanium cli update
      4. attempt to do npm install commander any where at the CLI (it could be any module on npm)
      5. you should get error like the following

        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
        

      To workaround this issue, you can do the following:

      sudo chown -R USERNAME ~/.npm

      After which you can do npm installs again without sudo

        Attachments

          Activity

            People

            • Assignee:
              cwilliams Christopher Williams
              Reporter:
              tlukasavage Tony Lukasavage
              Reviewer:
              Praveen Innamuri (Inactive)
              Tester:
              Visalakshi Chidambaram
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: