如何安装maatwebsite/excel?

news/2024/7/21 4:13:35 标签: excel

背景

项目要下载内容,那最好是用扩展了,常用的也就是maatwebsite/excel,但是今天安装的提示异常

错误如下:

  Problem 1
    - maatwebsite/excel[3.1.28, ..., 3.1.30] require phpoffice/phpspreadsheet 1.16.* -> satisfiable by phpoffice/phpspreadsheet[1.16.0].
    - maatwebsite/excel[3.1.31, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, ..., 1.29.0].
    - maatwebsite/excel 3.1.27 requires phpoffice/phpspreadsheet ^1.16 -> satisfiable by phpoffice/phpspreadsheet[1.16.0, ..., 1.29.0].
    - maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> satisfiable by phpoffice/phpspreadsheet[1.15.0, ..., 1.29.0].
    - maatwebsite/excel[3.1.22, ..., 3.1.25] require phpoffice/phpspreadsheet ^1.14 -> satisfiable by phpoffice/phpspreadsheet[1.14.0, ..., 1.29.0].
    - phpoffice/phpspreadsheet[1.14.0, ..., 1.28.0] require maennchen/zipstream-php ^2.1 -> satisfiable by maennchen/zipstream-php[2.1.0, ..., v2.x-dev].
    - phpoffice/phpspreadsheet 1.29.0 requires maennchen/zipstream-php ^2.1 || ^3.0 -> satisfiable by maennchen/zipstream-php[2.1.0, ..., v2.x-dev, 3.0.0-beta.1, ..., 3.1.0].
    - maatwebsite/excel 3.1.0 requires illuminate/support ^5.5 -> found illuminate/support[v5.5.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - maatwebsite/excel[3.1.1, ..., 3.1.6] require illuminate/support 5.5.* || 5.6.* || 5.7.* -> found illuminate/support[v5.5.0, ..., 5.7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - maatwebsite/excel[3.1.7, ..., 3.1.15] require illuminate/support 5.5.*|5.6.*|5.7.*|5.8.* -> found illuminate/support[v5.5.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - maatwebsite/excel[3.1.16, ..., 3.1.18] require illuminate/support 5.5.*|5.6.*|5.7.*|5.8.*|^6.0 -> found illuminate/support[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require.
    - maatwebsite/excel[3.1.19, ..., 3.1.21] require illuminate/support 5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0 -> found illuminate/support[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - maennchen/zipstream-php[2.2.0, ..., v2.x-dev] require php ^8.0 -> your php version (7.4.14) does not satisfy that requirement.
    - maennchen/zipstream-php[2.1.0, ..., 2.2.6] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - maennchen/zipstream-php[3.0.0-beta.1, ..., 3.1.0] require php-64bit ^8.1 -> your php-64bit version (7.4.14) does not satisfy that requirement.
    - Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.1.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

解决之路

看到报错,错误的发生是因为composer无法加载phpoffice/phpspreadsheet包。正常情况下,composer能够安装依赖项,现手动试试让它安装的时候自动安装依赖项,

composer require maatwebsite/excel --update-with-dependencies

然后就正常了哈

导出excel时单元格内换行的问题,请点击这里查看


http://www.niftyadmin.cn/n/5024555.html

相关文章

HarmonyOS/OpenHarmony应用开发-DevEco Studio帮助快速入门的使用

DevEco Studio内置有帮助中心,初学HarmonyOS 及OpenHarmony应用、元服务的开发者,通过内置的帮助中去系统的学习相关内容,是边练边学,快速上手的最佳方式。 一、帮助 二、快速开始 三、HarmonyOS应用、元服务开发相关 四、OpenHa…

C#回调函数学习1

回调函数(Callback Function)是一种函数指针,它指向的是由用户自己定义的回调函数。我们将这个回调函数的指针作为参数传递给另外一个函数,在这个函数工作完成后,它将通过这个回调函数的指针来回调通知调用者处理结果。…

北京映急物流有限公司 面试.net软件工程师岗位

请实现以下算法,语言不限,也可以是伪代码。 1.有一个数组 a[1000]存放了1000整数,这 1000 个数都大于等于 1,小于等于999,并且只有两个数是相同的,剩下的 998 个数均不相同。请写一个最优搜索算法,找出相同…

element-ui框架的el-dialog弹出框被遮罩层挡住了/el-drawer....会生成v-model元素的组件被遮罩层挡住

element-ui框架的el-dialog弹出框被遮罩层遮挡问题_前端李十三的博客-CSDN博客可以发现el-dialog 组件显示的时候被遮罩层挡住了。https://blog.csdn.net/weixin_64530670/article/details/131173159?ydrefereraHR0cHM6Ly9tcC5jc2RuLm5ldC9tcF9ibG9nL21hbmFnZS9hcnRpY2xlP3Nwb…

CC2530中文数据手册

分享一下cc2530的中文数据手册 下载地址:【免费】CC2530中文数据手册完全版资源-CSDN文库 最近在学习ZigBee的开发,使用的是cc2530芯片,在网上找参考手册的时候,发现就各种收费,找到一个免费的太难了,就在这…

短信验证码的登录注册功能

1 基于session实现登录流程 1.1发送验证码: 用户在提交手机号后,会校验手机号是否合法,如果不合法,则要求用户重新输入手机 如果手机号合法,后台此时生成对应的验证码,同时将验证码进行保存,然…

absl教程(五):Synchronization library

absl教程&#xff08;五&#xff09;&#xff1a;Synchronization library #include <iostream> #include <mutex> #include <absl/synchronization/mutex.h>using namespace std;// GUARDED_BY LOCKS_EXCLUDED EXCLUSIVE_LOCKS_REQUIRED mutex mu; int f()…

苹果iPhone 15/Pro新机发布,毫米波5G仍然只限美国版

苹果公司今日发布了 iPhone 15 系列新机&#xff0c;共四款&#xff0c;分别是 iPhone 15、iPhone 15 Plus、iPhone 15 Pro 和 iPhone 15 Pro Max。这些新机型都配备了 USB-C 接口和灵动岛&#xff0c;而 Pro 版还有更多的特色功能&#xff0c;如 A17 Pro 芯片、轻质钛金属框架…