Docker Installation Failure - NPM Permissions Error

HOST OS:  Ubuntu 18.04

Steps Taken: (For Docker Installation of Shopware 6)

 git clone git@github.com:shopware/development.git
 cd development
 ./psh.phar docker:start (Platform will be a vendor dependency)
 ./psh.phar docker:ssh
 ./psh.phar install

 

The installation script fails at Step 25

> npm clean-install --prefix vendor/shopware/platform/src/Administration/Resources/app/administration

Error reported as:

    npm ERR! code EACCES
    npm ERR! syscall open
    npm ERR! path /.npm/_cacache/tmp/f8dd11e8
    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 1000:1000 “/.npm”

 

NPM version in docker is_: 6.14.4_

From the  Dockerfile  for the app container, you have…

_&& chown -R {USER\_ID}:{GROUP_ID} ${NPM_CONFIG_CACHE} _

 

I could not find any recent references on the forum to this issue, so therefore, I am highlighting this issue in case it happens for anyone else…

Actually, this error is resolved for me now.

For anyone stuck, you need to „log into“ your docker container as root. Either by using „docker exec“ directly, or there is a ssh-rrot command from .phar. Once there, you can „cd…“  and find the .npm directory. And then chown from there…

1 „Gefällt mir“