尝试使用 Docker 启动已安装的 Symfony“Akeneo PIM”时,EACES 权限被拒绝

问题描述

我在星期一开始了我的第一个实习,我正在研究由 Akeneo 创建的 PIM,它是使用 Symfony 构建的。他们有一个很好的指南可以在他们的网站上安装它,我想我也应该学习 docker。 以下是我迄今为止遵循的说明: https://docs.akeneo.com/latest/install_pim/docker/installation_docker.html

我只是在安装之前没有配置我的包管理器,因为在搜索之后我并没有真正找到如何或在哪里做到这一点。 (他们谈论纱线和作曲家的认值的部分)。

如果我不使用 sudo,安装将不起作用,“make dev”也是如此。

以下是 make dev 的错误消息:

make dependencies
make[1]: Entering directory '/mnt/c/Users/Yvesa/pim'
docker-compose run -u www-data --rm PHP PHP -d memory_limit=4G /usr/local/bin/composer update
Creating pim_PHP_run ... done
Cannot create cache directory /var/www/.composer/cache/repo/https---repo.packagist.org/,or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.composer/cache/files/,or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.composer/cache/repo/https---flex.symfony.com/,or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies
Cannot create cache directory /var/www/.composer/cache/repo/https---repo.packagist.org/,or directory is not writable. Proceeding without cachenothing to modify in lock file
Installing dependencies from lock file (including require-dev)
nothing to install,update or remove
Package doctrine/doctrine-cache-bundle is abandoned,you should avoid using it. No replacement was suggested. Package doctrine/reflection is abandoned,you should avoid using it. Use roave/better-reflection instead.
Package symfony/inflector is abandoned,you should avoid using it. Use use `EnglishInflector` from the String component instead instead.
Package twig/extensions is abandoned,you should avoid using it. No replacement was suggested.
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
76 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony recipes are disabled: "symfony/flex" not found in the root composer.json

> bash vendor/akeneo/pim-community-dev/std-build/install-required-files.sh
src/ directory already exists. Not preparing the directory content.
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 docker-compose run -u node --rm -e YARN_REGISTRY -e PUPPETEER_SKIP_CHROMIUM_DOWNLOAD node yarn install
Creating pim_node_run ... done
yarn install v1.22.5
error An unexpected error occurred: "EACCES: permission denied,mkdir '/home/node/.yarn/v6'".
info If you think this is a bug,please open a bug report with the information provided in "/srv/pim/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR: 1
make[1]: *** [Makefile:21: node_modules] Error 1
make[1]: Leaving directory '/mnt/c/Users/Yvesa/pim'
make: *** [Makefile:74: dev] Error 2
❯ Cannot create cache directory /var/www/.composer/cache/repo/https---repo.packagist.org/,or directory is not writable. Proceeding without cache
❯ code ~/.zshrc
^[[A^C
❯ cd ~/
❯ sudo chmod -R 777 .cache
❯ z /mnt/c/Users/Yvesa/pim
❯ sudo make dev
make dependencies
make[1]: Entering directory '/mnt/c/Users/Yvesa/pim'
docker-compose run -u www-data --rm PHP PHP -d memory_limit=4G /usr/local/bin/composer update
Creating pim_PHP_run ... done
Cannot create cache directory /var/www/.composer/cache/repo/https---repo.packagist.org/,or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies
nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
nothing to install,please open a bug report with the information provided in "/srv/pim/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR: 1
make[1]: *** [Makefile:21: node_modules] Error 1
make[1]: Leaving directory '/mnt/c/Users/Yvesa/pim'
make: *** [Makefile:74: dev] Error 2
❯ "EACCES: permission denied,mkdir '/home/node/.yarn/v6'"

我发现有人和我有类似的问题,他解决了他的问题,因为他的根目录中的 .config 文件错误的权限(sudo 而不是用户名),所以我 chown 并更改了它,现在它有了我的用户名权限,我还 chmod 777 .cache,但似乎没有帮助。

我真的很新,我真的很想拥有自己的开发环境来练习学习 PHP 连接器、REST api 调用以及我需要这个 symfony/akeneo/docker 环境的所有东西......

我知道这是一个很大的问题,但如果有人能提供帮助,那将是一种巨大的解脱,非常感谢!

解决方法

首先说明一点:Akeneo 是开发 PIM 的社团,而不是 PIM 的名称。 PIM 是他的名字。 ;)

该错误信息表示在创建存储库/home/node/.yarn/v6 期间,它获得了错误的权限。 所以检查 /home/node 和 /home/node/.yarn 存储库的权限;)

如果权限不正确,chmod 或 chown 并重试安装命令。

最好的问候, 艾洛蒂

,

也许你已经自己想出来了,但为了记录:

运行时

docker-compose run node ls -lah /home/node

您看到 .yarn 拥有根所有权。您可以通过运行来更改它:

docker-compose run -u root node chown -R node:node /home/node/.yarn

之后,您应该能够正确运行 make