首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“无法创建缓存目录/home/<user>/.composer/cache/repo/https---packagist.org/,或目录不可写。没有缓存继续进行”

“无法创建缓存目录/home/<user>/.composer/cache/repo/https---packagist.org/,或目录不可写。没有缓存继续进行”
EN

Ask Ubuntu用户
提问于 2018-09-24 03:07:50
回答 1查看 35.6K关注 0票数 13

新手来了。

我试图在我的Ubuntu中安装MISP,遵循以下安装指南:INSTALL.ubuntu1804.txt

当涉及到这个指令时:

代码语言:javascript
复制
# Once done, install CakeResque along with its dependencies if you intend to use the built in background jobs:
cd /var/www/MISP/app
sudo -u www-data php composer.phar require kamisama/cake-resque:4.1.2

我拿到了这个:

代码语言:javascript
复制
Cannot create cache directory /home/akatiubuntutest/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/akatiubuntutest/.composer/cache/files/, or directory is not writable. Proceeding without cache
./composer.json has been updated
Cannot create cache directory /home/akatiubuntutest/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/akatiubuntutest/.composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing monolog/monolog (1.23.0)
    Downloading: 65%^C        

我在这里尝试了这个解决方案,无法创建缓存目录!用作曲家创建laravel项目时帮我解决这个问题

代码语言:javascript
复制
sudo chown -R <user> /home/<user>/.composer/cache/repo/https---packagist.org

但是(从逻辑上讲,由于它尚未创建),我得到了以下信息:

代码语言:javascript
复制
chown: cannot access '/home/<user>/.composer/cache/repo/https---packagist.org/': No such file or directory

我已经安装了PHP和依赖项:

代码语言:javascript
复制
# Install PHP and dependencies
sudo apt-get install libapache2-mod-php php php-cli php-gnupg php-dev php-json php-mysql php-opcache php-readline php-redis php-xml php-mbstring

现在,我不知道我错过了什么。

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-11-01 13:05:13

在我看来,你的命令中缺少小组的信息。

代码语言:javascript
复制
sudo chown -R <user> /home/<user>/.composer/cache/repo/https---packagist.org

应该是

代码语言:javascript
复制
sudo chown -R <user>:<group> /home/<user>/.composer/cache/repo/https---packagist.org

但为避免出现其他许可问题,我建议:

代码语言:javascript
复制
sudo chown -R <user>:<group> /home/<user>/.composer/cache

(您需要访问那里的其他文件夹)

代码语言:javascript
复制
sudo chown <user>:<group> /home/<user>/.composer

以确保用户对全局编写器文件夹拥有足够的权限。注意缺少的递归,这样用户就不会拥有由root创建的键。如果你需要找出这个组:

代码语言:javascript
复制
groups <user>
票数 9
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1077879

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档