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

EACES permission denied when trying to launch an installed Symfony "Akeneo PIM" with Docker

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

我只是在安装之前没有配置我的包管理器,因为在搜索之后我并没有真正找到如何或在哪里进行配置。 (他们谈论 yarn 和 composer 的默认值的部分)。

如果我不使用 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
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
Nothing 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
❯ "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 拥有 root 所有权。您可以通过 运行ning:

更改它

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

在那之后你应该能够 运行 make 正确。

这对我适用于 Akeneo PIM 3.7:

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