php - 尝试使用 Docker 启动已安装的 Symfony“Akeneo PIM”时,EACES 权限被拒绝
问题描述
我在周一开始了我的第一次实习,我正在研究一个由 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 环境的所有东西......
我知道这是一个很大的问题,但如果有人能提供帮助,那将是一个巨大的解脱,非常感谢!
解决方案
也许您已经自己弄清楚了,但为了记录:
跑步时
docker-compose run node ls -lah /home/node
您会看到它.yarn
具有根所有权。您可以通过运行来更改它:
docker-compose run -u root node chown -R node:node /home/node/.yarn
之后,您应该能够make
正常运行。
推荐阅读
- c# - 遍历所有未选中的复选框(foreach 或 for-loop,Windows 窗体)
- asp.net-mvc - 如何在 ASP.Net Core 中将密码重置为不同的域?
- python - 如何强制 pyinstaller 使用原始 .py 文件进行快速更新而不重新创建 exe?
- python - 解析字符串中的嵌套引用
- javascript - “提交”事件处理程序只触发一次,第一次后不会工作
- swiftui - KFImage图像加载但不显示?
- flutter - 我试图从 cloud firestore 获取文档,但我无法,因为“没有为类型 'QuerySnapshot' 定义 getter 'documents'
- vba - 更新 setfocus 后无法访问 VBA
- node.js - 将 react-native 应用程序连接到 mongodb 和 nodejs 服务器
- reactjs - Spring Boot / React 阻止 CORS