Composer常见错误有哪些
发表于:2024-10-27 作者:千家信息网编辑
千家信息网最后更新 2024年10月27日,这篇文章主要介绍了Composer常见错误有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。执行composer install遇到
千家信息网最后更新 2024年10月27日Composer常见错误有哪些
这篇文章主要介绍了Composer常见错误有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
执行composer install遇到错误:Your requirements could not be resolved to an installable set of packages. 这是因为不匹配composer.json要求的版本。
完整错误如下:
vagrant@homestead:/usr/share/nginx/html/laravel-blog$ sudocomposerinstallLoadingcomposerrepositorieswithpackage informationInstallingdependencies (includingrequire-dev) fromlockfileYourrequirementscouldnot beresolvedto aninstallablesetofpackages. Problem 1 - Installationrequestfor doctrine/instantiator 1.0.3 -> satisfiablebydoctrine/instantiator[1.0.3]. - doctrine/instantiator 1.0.3 requiresphp ~5.3 -> yourPHPversion (7.0.3) doesnot satisfythatrequirement. Problem 2 - doctrine/instantiator 1.0.3 requiresphp ~5.3 -> yourPHPversion (7.0.3) doesnot satisfythatrequirement. - phpunit/phpunit-mock-objects 2.3.0 requiresdoctrine/instantiator ~1.0,>=1.0.1 -> satisfiablebydoctrine/instantiator[1.0.3]. - Installationrequestfor phpunit/phpunit-mock-objects 2.3.0 -> satisfiablebyphpunit/phpunit-mock-objects[2.3.0].
提示我的PHP 7版本太高,不符合composer.json需要的版本,但是在PHP 7下应该也是可以运行的,composer可以设置忽略版本匹配,命令是:
composerinstall --ignore-platform-reqsorcomposerupdate --ignore-platform-reqs
再次执行composer命令可以正常安装包了。
如果提示警告:
Cannotcreatecachedirectory /home/vagrant/.composer/cache/repo/https---packagist.org/, or directoryis not writable. Proceedingwithoutcache Cannotcreatecachedirectory /home/vagrant/.composer/cache/files/, or directoryis not writable. Proceedingwithoutcache
这是在虚拟机中执行composer,提示这个目录没有可写权限,composer无法缓存下载的包,这样就每次都得重新下载,把目录改成可写可读即可。
sudo chmod -R 777 /home/vagrant/.composer/cache/files/
另外,在虚拟机中也设置composer为国内镜像,不然下载速度慢的要死,执行:
composerconfig -g repo.packagistcomposerhttps://packagist.phpcomposer.com
OK,大功告成。
感谢你能够认真阅读完这篇文章,希望小编分享的"Composer常见错误有哪些"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!
错误
版本
篇文章
提示
常见
命令
是在
目录
大功告成
价值
兴趣
再次
同时
大功
更多
朋友
权限
知识
缓存
编带
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
迅腾国际软件开发工程师
pci-e服务器网卡功率
河北广宗网络安全从我做起
江苏潮流软件开发服务应用
迪庆软件开发项目管理培训
潘廷柱 网络安全
以scott登录数据库
网络安全与信息安全管理比赛
湖南客户管理软件开发平台
戴尔服务器添加硬盘
ibm服务器有哪些
服务器管理控制台停止工作
浙江企业软件开发现价
软件开发不予验收
网络安全工作要点网信
新炬网络技术有限公司杭州
Mac下的win可以装数据库吗
苹果账号一直连接不上服务器
奥维的服务器地址是多少
江阴ibm服务器维修网点
桂城网络安全设备
迪庆软件开发项目管理培训
金蝶数据库库存表
云南专业网络技术服务工程
db2数据库前滚回滚
知名l2tp服务器托管公司
传说对决欧服服务器
国内客户软件开发
天津静海凶宅数据库
orcl数据库账户被锁定