Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-4517

Change ownership of dot folders at the end of the UDI build

XMLWordPrintable

    • False
    • None
    • False

      Opening an empty workspace and trying to run npm install nodeshift fails:

      projects $ npm install nodeshift
      npm ERR! code EACCES
      npm ERR! syscall mkdir
      npm ERR! path /home/user/.npm/_cacache
      npm ERR! errno -13
      npm ERR! 
      npm ERR! Your cache folder contains root-owned files, due to a bug in
      npm ERR! previous versions of npm which has since been addressed.
      npm ERR! 
      npm ERR! To permanently fix this problem, please run:
      npm ERR!   sudo chown -R 1035440000:0 "/home/user/.npm"
      
      npm ERR! Log files were not written due to an error writing to the directory: /home/user/.npm/_logs
      npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
      

      (And running sudo chown -R 1035440000:0 "/home/user/.npm" fails too, of course).

      This problem is not specific to `~/.npm` as any can occur for any dot folder that has been created during the build (as it result as owned by `root`).

      Note that upstream this problem is already solved: https://github.com/devfile/developer-images/blob/main/universal/ubi8/Dockerfile#LL421C47-L421C60

              mloriedo Mario Loriedo
              mloriedo Mario Loriedo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: