Linux|centos7|yum和编译安装ImageMagick记录

一,

yum安装imagemagick

imagemagick这个软件是图像文件的处理神器,可以文字转图像以及图像的剪辑等等工作,也是配合人工智能工程的不可或缺的工具,具体的用处和特点就不在这里废话了,有兴趣的百度就行了 

本次是在centos7最小化安装基础上安装此软件,因此,首先需要配置yum源,由于centos7已经算是弃用版本,因此,yum源需要配置centos-valute

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

以上两个源是阿里云的基础源和epel源,这两个源的作用是安装ImageMagick的时候担心某些依赖没有的话,做一个补充

下面开始配置centos的过期源,过期源里包含有centos7的一些比较不常用的软件,例如这个ImageMagick

查看本机的centos版本:

[root@node2 SPECS]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)

编写repo文件,文件内容如下,其它centos版本都一样,只是把版本号替换掉就可以了,此源里包含ImageMagick

[ewrew]
name=12321
baseurl=https://mirrors.aliyun.com/centos-vault/7.7.1908/os/x86_64
enable=1
gpgcheck=0

🆗,现在就可以使用yum安装ImageMagick了,命令如下:

yum install ImageMagick -y
###安装完毕后,查看convert命令的版本,验证是否正常安装完毕
[root@node1 ~]# convert --version
Version: ImageMagick 6.9.10-68 Q16 x86_64 2024-01-12 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(3.1) 
Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff wmf x xml zlib

######注:convert命令 就是magick命令,随之安装的还有import,identify,display等等命令

ImageMagick就这么简单的安装好了!!!!!

二、

编译安装ImageMagick

编译安装也有很多方式,比如,直接源码包经过预编译-编译-安装这样的方式,也有将这三个阶段合并到一起的方式,例如src-rpm的方式,直接编译出rpm文件

第二种方式方便移植,自动化程度高一点,本次将采用src-rpm的方式安装

源码包下载地址:

Index of /archive/linux/SRPMS/releases

这里版本比较多,尽量使用7版本的,反正6.5版本我是没有编译成功

我使用的是ImageMagick-7.0.10-34.src.rpm,这个安装包看起来比较奇怪,带一个src,这里的意思是源码的意思

此包rpm -ivh 后将会自动创建rpmbuild目录,然后进入此目录编译并生成当前版本可用的rpm包,下面是编译步骤

1、

将上面的rpm包上传到服务器上备用,先配置yum源:

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

2、

安装ImageMagick-7.0.10-34.src.rpm,以创建rpmbuild文件夹,并安装rpmbuild命令

[root@centos7 ~]# rpm -ivh ImageMagick-7.0.10-34.src.rpm 
Updating / installing...1:ImageMagick-7.0.10-34            ################################# [100%]
warning: user cristy does not exist - using root
warning: group cristy does not exist - using root
warning: user cristy does not exist - using root
warning: group cristy does not exist - using root[root@centos7 ~]# ls -al rpmbuild/SPECS/
total 12
drwxr-xr-x 2 root root    30 Feb 28 04:35 .
drwxr-xr-x 4 root root    34 Feb 28 04:35 ..
-rw-rw-r-- 1 root root 11023 Oct  8  2020 ImageMagick.spec[root@centos7 SPECS]# yum install rpm-build -y

ImageMagick.spec 是编译脚本,内容是哪些依赖,如何调用,怎么编译,怎么安装的,这里就不详细讲了 

3、

测试安装看缺少哪些依赖并安装依赖

[root@centos7 SPECS]# rpmbuild -ba ImageMagick.spec 
error: Failed build dependencies:bzip2-devel is needed by ImageMagick-7.0.10-34.x86_64freetype-devel is needed by ImageMagick-7.0.10-34.x86_64libjpeg-devel is needed by ImageMagick-7.0.10-34.x86_64libpng-devel is needed by ImageMagick-7.0.10-34.x86_64libtiff-devel is needed by ImageMagick-7.0.10-34.x86_64giflib-devel is needed by ImageMagick-7.0.10-34.x86_64perl-devel >= 5.8.1 is needed by ImageMagick-7.0.10-34.x86_64perl-generators is needed by ImageMagick-7.0.10-34.x86_64ghostscript-devel is needed by ImageMagick-7.0.10-34.x86_64djvulibre-devel is needed by ImageMagick-7.0.10-34.x86_64libwmf-devel is needed by ImageMagick-7.0.10-34.x86_64libX11-devel is needed by ImageMagick-7.0.10-34.x86_64libXext-devel is needed by ImageMagick-7.0.10-34.x86_64libXt-devel is needed by ImageMagick-7.0.10-34.x86_64lcms2-devel is needed by ImageMagick-7.0.10-34.x86_64libxml2-devel is needed by ImageMagick-7.0.10-34.x86_64librsvg2-devel is needed by ImageMagick-7.0.10-34.x86_64OpenEXR-devel is needed by ImageMagick-7.0.10-34.x86_64fftw-devel is needed by ImageMagick-7.0.10-34.x86_64libwebp-devel is needed by ImageMagick-7.0.10-34.x86_64jbigkit-devel is needed by ImageMagick-7.0.10-34.x86_64openjpeg2-devel >= 2.1.0 is needed by ImageMagick-7.0.10-34.x86_64autoconf is needed by ImageMagick-7.0.10-34.x86_64automake is needed by ImageMagick-7.0.10-34.x86_64libtool-ltdl-devel is needed by ImageMagick-7.0.10-34.x86_64

可以看到缺少的依赖比较多,但有两个比较特殊openjpeg2-devel >= 2.1.0 ,perl-devel >= 5.8.1这两个个依赖对版本有要求,那么这个软件是在centos-valute过期源里面的,因此,添加过期源:

[ewrew]
name=12321
baseurl=https://mirrors.aliyun.com/centos-vault/7.7.1908/os/x86_64
enable=1
gpgcheck=0

开始安装依赖,命令如下:

yum install  bzip2-devel freetype-devel  libjpeg-devel libpng-devel  libtiff-devel giflib-devel perl-devel perl-generators  ghostscript-devel  djvulibre-devel ibwmf-devel libX11-devel libXext-devel libXt-devel   lcms2-devel libxml2-devel OpenEXR-devel fftw-devel libwebp-devel jbigkit-devel openjpeg2-devel autoconf automake libtool-ltdl-devel -y

安装完毕后,在执行上面的命令,可以看到还缺少两个依赖,安装命令如下:

缺少依赖的报错:

[root@centos7 SPECS]# rpmbuild -ba ImageMagick.spec 
error: Failed build dependencies:libwmf-devel is needed by ImageMagick-7.0.10-34.x86_64librsvg2-devel is needed by ImageMagick-7.0.10-34.x86_64

依赖安装命令:

yum install libwmf-devel librsvg2-devel -y


###看看上面两个指定版本的依赖安装情况,可以看到都符合要求了:

[root@centos7 x86_64]# rpm -qa |grep openjpeg2-devel
openjpeg2-devel-2.3.1-3.el7_7.x86_64
[root@centos7 x86_64]# rpm -qa |grep perl-devel
perl-devel-5.16.3-299.el7_9.x86_64

4、

这个最后两个依赖安装完就可以顺畅的执行rpmbuild -ba ImageMagick.spec这个命令了。编译完成的末尾日志如下:

Wrote: /root/rpmbuild/SRPMS/ImageMagick-7.0.10-34.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-devel-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-libs-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-djvu-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-doc-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-perl-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-c++-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-c++-devel-7.0.10-34.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-debuginfo-7.0.10-34.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.zyhQ3N
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd ImageMagick-7.0.10-34
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/ImageMagick-7.0.10-34.x86_64
+ exit 0
[root@centos7 SPECS]# echo $?
0

编译成果如下,在RPMS这个目录下:

[root@centos7 SPECS]# cd ../RPMS/x86_64/
[root@centos7 x86_64]# ls
ImageMagick-7.0.10-34.x86_64.rpm      ImageMagick-c++-devel-7.0.10-34.x86_64.rpm  ImageMagick-devel-7.0.10-34.x86_64.rpm  ImageMagick-doc-7.0.10-34.x86_64.rpm   ImageMagick-perl-7.0.10-34.x86_64.rpm
ImageMagick-c++-7.0.10-34.x86_64.rpm  ImageMagick-debuginfo-7.0.10-34.x86_64.rpm  ImageMagick-djvu-7.0.10-34.x86_64.rpm   ImageMagick-libs-7.0.10-34.x86_64.rpm

5、

使用这些rpm包

[root@centos7 x86_64]# yum install ./*

ImageMagick就这么简单的安装完毕了,完结!!!!撒花!!!! 

三、

windows和Linux源码以及简单编译

Windows版本的ImageMagick下载地址:

ImageMagick – Download

Linux的源码包下载地址:

https://github.com/ImageMagick/ImageMagick/releases

源码编译:

编译前的依赖安装如下:

 yum install  bzip2-devel freetype-devel  libjpeg-devel libpng-devel  libtiff-devel giflib-devel perl-devel perl-generators  ghostscript-devel  djvulibre-devel ibwmf-devel libX11-devel libXext-devel libXt-devel   lcms2-devel libxml2-devel OpenEXR-devel fftw-devel libwebp-devel jbigkit-devel openjpeg2-devel autoconf automake libtool-ltdl-devel libzstd-devel zstd autotrace-devel autotrace libzip zlib zlib-devel libtool-ltdl-devel perl perl-devel gcc gcc-c++  libwebp-devel libwebp-tools -y

预编译命令:

进入解压后的目录,新建build目录然后进入build目录执行编译,如果有错找不到原因,可以删空build目录,重新编译


mkdir build
cd build../configure --enable-shared         --disable-static         --with-modules         --with-perl         --with-x         --with-threads         --with-magick_plus_plus         --with-wmf         --with-webp         --with-openexr         --with-gslib         --with-rsvg         --with-xml         --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'"                  --without-gcc-arch         --with-jbig --with-fftw --with-fpx --with-flif --with-autotrace=yes

预编译的日志,可以看到基本各种图像格式都开启支持了:

Host system type: x86_64-pc-linux-gnu
Build system type: x86_64-pc-linux-gnuOption                              Value
------------------------------------------------------------------------------
Shared libraries    --enable-shared=yes		        yes
Static libraries    --enable-static=no		        no
Module support      --with-modules=yes		        yes
GNU ld              --with-gnu-ld=yes		        yes
OpenMP              --enable-openmp=		        yes
Security policy     --with-security-policy=open	        open
Quantum depth       --with-quantum-depth=16	        16
High Dynamic Range Imagery--enable-hdri=no		        noInstall documentation:				        yesMemory allocation library:JEMalloc          --with-jemalloc=no		        noMTMalloc          --with-mtmalloc=no		        noTCMalloc          --with-tcmalloc=no		        noUMem              --with-umem=no		        noDelegate library configuration:BZLIB             --with-bzlib=yes		        yesAutotrace         --with-autotrace=yes		        noDJVU              --with-djvu=yes		        yesDPS               --with-dps=no		        noFFTW              --with-fftw=yes		        yesFLIF              --with-flif=yes		        noFlashPIX          --with-fpx=yes		        noFontConfig        --with-fontconfig=yes	        yesFreeType          --with-freetype=yes		        yesGhostscript lib   --with-gslib=yes		        yesGraphviz          --with-gvc=yes		        noHEIC              --with-heic=yes		        noJBIG              --with-jbig=yes		        yesJPEG v1           --with-jpeg=yes		        yesLCMS              --with-lcms=yes		        yesLQR               --with-lqr=yes		        noLTDL              --with-ltdl=yes		        yesLZMA              --with-lzma=yes		        yesMagick++          --with-magick-plus-plus=yes	        yesOpenEXR           --with-openexr=yes		        yesOpenJP2           --with-openjp2=yes		        yesPANGO             --with-pango=yes		        yesPERL              --with-perl=yes		        /usr/bin/perlPNG               --with-png=yes		        yesRAQM              --with-raqm=yes		        noRAW               --with-raw=yes		        noRSVG              --with-rsvg=yes		        yesTIFF              --with-tiff=yes		        yesWEBP              --with-webp=yes		        noWMF               --with-wmf=yes		        yesX11               --with-x=yes			        yesXML               --with-xml=yes		        yesZLIB              --with-zlib=yes		        yesZSTD              --with-zstd=yes		        yesDelegate program configuration:GhostPCL          None			        pcl6 (unknown)GhostXPS          None			        gxps (unknown)Ghostscript       None			        gs (unknown)Font configuration:Apple fonts       --with-apple-font-dir=default	Dejavu fonts      --with-dejavu-font-dir=default	noneGhostscript fonts --with-gs-font-dir=default		noneURW-base35 fonts  --with-urw-base35-font-dir=default	/usr/share/fonts/urw-base35/Windows fonts     --with-windows-font-dir=default	none

这个基本没什么好说的,上面提到的依赖都安装好自然就水到渠成了,预编译完成后,make&& make install 就完成了

编译完成的日志如下:

la -rpath /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/filters filters/analyze_la-analyze.lo MagickCore/libMagickCore-7.Q16HDRI.la -lm )
libtool: install: /usr/bin/install -c filters/.libs/analyze.soT /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/filters/analyze.so
libtool: install: /usr/bin/install -c filters/.libs/analyze.lai /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/filters/analyze.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/filters
----------------------------------------------------------------------
Libraries have been installed in:/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/filtersIf you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:- add LIBDIR to the 'LD_LIBRARY_PATH' environment variableduring execution- add LIBDIR to the 'LD_RUN_PATH' environment variableduring linking- use the '-Wl,-rpath -Wl,LIBDIR' linker flag- have your system administrator add LIBDIR to '/etc/ld.so.conf'。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。/usr/bin/install -c -m 644 ../Magick++/lib/Magick++/Blob.h ../Magick++/lib/Magick++/CoderInfo.h ../Magick++/lib/Magick++/Color.h ../Magick++/lib/Magick++/Drawable.h ../Magick++/lib/Magick++/Exception.h ../Magick++/lib/Magick++/Functions.h ../Magick++/lib/Magick++/Geometry.h ../Magick++/lib/Magick++/Image.h ../Magick++/lib/Magick++/Include.h ../Magick++/lib/Magick++/Montage.h ../Magick++/lib/Magick++/Pixels.h ../Magick++/lib/Magick++/ResourceLimits.h ../Magick++/lib/Magick++/SecurityPolicy.h ../Magick++/lib/Magick++/Statistic.h ../Magick++/lib/Magick++/STL.h ../Magick++/lib/Magick++/TypeMetric.h '/usr/local/include/ImageMagick-7/Magick++'/usr/bin/mkdir -p '/usr/local/include/ImageMagick-7'/usr/bin/install -c -m 644 ../Magick++/lib/Magick++.h '/usr/local/include/ImageMagick-7'/usr/bin/mkdir -p '/usr/local/share/man/man1'/usr/bin/install -c -m 644 ../MagickCore/MagickCore-config.1 ../MagickWand/MagickWand-config.1 ../Magick++/bin/Magick++-config.1 utilities/ImageMagick.1 utilities/animate.1 utilities/compare.1 utilities/composite.1 utilities/conjure.1 utilities/convert.1 utilities/display.1 utilities/identify.1 utilities/import.1 utilities/magick.1 utilities/magick-script.1 utilities/mogrify.1 utilities/montage.1 utilities/stream.1 '/usr/local/share/man/man1'/usr/bin/mkdir -p '/usr/local/lib/pkgconfig'/usr/bin/install -c -m 644 MagickCore/ImageMagick.pc MagickCore/ImageMagick-7.Q16HDRI.pc MagickCore/MagickCore.pc MagickCore/MagickCore-7.Q16HDRI.pc MagickWand/MagickWand.pc MagickWand/MagickWand-7.Q16HDRI.pc Magick++/lib/Magick++.pc Magick++/lib/Magick++-7.Q16HDRI.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/root/ImageMagick-7.1.1-20/build'
make[1]: Leaving directory `/root/ImageMagick-7.1.1-20/build'

编译的时候需要注意,上面提到的预编译里面no不要太多,要不很多功能用不了,最后注意上面日志的提示

Libraries have been installed in:
   /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/filters

这个目录还是加入到/etc/ld.so.conf 文件内,防止一些不清楚的错误

[root@centos7 ~]# ls -al /usr/local/lib/ImageMagick-6.9.13/modules-Q16/filters
total 40
drwxr-xr-x 2 root root    42 Feb 29 06:12 .
drwxr-xr-x 4 root root    35 Feb 29 06:12 ..
-rwxr-xr-x 1 root root  1100 Feb 29 06:12 analyze.la
-rwxr-xr-x 1 root root 35976 Feb 29 06:12 analyze.so

加入ld.so.conf 文件内,防止lib库不正常 

[root@centos7 ~]# echo /usr/local/lib/ImageMagick-6.9.13/modules-Q16/filters >>/etc/ld.so.conf
[root@centos7 ~]# ldconfig 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/500065.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【Redis】深入理解 Redis 常用数据类型源码及底层实现(6.详解Set和ZSet数据结构)

本文是深入理解 Redis 常用数据类型源码及底层实现系列的第6篇~前5篇可移步( ̄∇ ̄)/ 【Redis】深入理解 Redis 常用数据类型源码及底层实现(1.结构与源码概述)-CSDN博客 【Redis】深入理解 Redis 常用数据类型源码及底…

【电路笔记】-RC网络-RC积分器

RC积分器 文章目录 RC积分器1、概述2、RC积分器3、电容电压4、单脉冲 RC 积分器5、RC积分器示例6、RC 积分器作为正弦波发生器7、总结RC 积分器是一个串联的 RC 网络,可产生与积分的数学过程相对应的输出信号。 1、概述 对于无源 RC 积分器电路,输入连接到电阻,而输出电压取…

Mybatis plus批量插入的优化

目录 1 前言 2 优化 2.1 逐条的插入 2.1.1 java的代码如下 2.1.2 耗时 2.1.3 优化 2.2 批量编译再插入 2.2.1 java的代码如下 2.2.2 耗时 2.2.3 疑问 2.2.4 优化 2.3 真-批量插入 1 前言 数据库的常见操作无非增删查改,当有大量数据需要插入的时候&…

[云原生] K8s之pod进阶

一、pod的状态说明 (1)Pod 一直处于Pending状态 Pending状态意味着Pod的YAML文件已经提交给Kubernetes,API对象已经被创建并保存在Etcd当中。但是,这个Pod里有些容器因为某种原因而不能被顺利创建。比如,调度不成功(…

qt学习:实战 记事本 + 快捷键 + 鼠标滚轮 + 打开读取写入关闭文件

目录 功能 步骤 配置ui界面 添加图片资源 添加头文件和定义成员数据和成员函数 在构造函数里初始化 增加当前字体大小函数 减小当前字体大小函数 在用户按下 Ctrl 键的同时滚动鼠标滚轮时,执行放大或缩小操作 多选框变化后发出信号绑定槽函数来改变编码 …

鸿蒙ArkTs开发问题总结

版本问题 现阶段鸿蒙ArkTs开发主要分为两个版本 HarmonyOS3.x.x(API9)及HarmonyOS4.x.x(API10) 一下简称为 API9,API10 官方现在所有案例均以 HarmonyOS4.x.x(API10) 为基础请注意选择分支 API9&HarmonyOS3.x.x 鸿蒙开发编译器默认下载的为public版本SDK不是全量SDK需要…

高光谱遥感学习入门丨高光谱数据处理基础、Python和Matlab高光谱遥感数据处理

目录 ①Python高光谱遥感数据处理与高光谱遥感机器学习方法深度应用 ②Matlab高光谱遥感、数据处理与混合像元分解实践技术应用 ③高光谱遥感数值建模技术及在植被、水体、土壤信息提取领域应用 更多应用 高光谱遥感信息对于我们认识世界具有重要意义。尽管大部分物质在人眼…

Google Genie:创意互动环境

每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗?订阅我们的简报,深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同,从行业内部的深度分析和实用指南中受益。不要错过这个机会,成为AI领…

经典DP-最长单调子序列

最长递增子序列 思路 定义状态: 我们定义一个数组 dp,其中 dp[i] 表示以 nums[i] 结尾的最长递增子序列的长度。初始化状态: 对于数组中的每个元素 nums[i],初始时都可以被视为一个长度为1的递增子序列,因此 dp[i] 的…

2.29IO进程线程

编写链表&#xff0c;链表里面随便搞点数据 使用 fprintf 将链表中所有的数据&#xff0c;保存到文件中 使用 fscanf 读取文件中的数据&#xff0c;写入链表中 #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h>typed…

“集世界精华·展中国风采”2024北京智能科技展会(世亚智博会)

在科技的浪潮中&#xff0c;中国犹如一艘乘风破浪的巨轮&#xff0c;稳健地航行在广阔的海洋上。随着科技的飞速发展&#xff0c;中国正逐渐成为全球科技领域的一面旗帜&#xff0c;引领着世界科技潮流。在这个伟大的时代&#xff0c;中国以卓越的科技创新能力和前瞻的战略视野…

vue-electron 项目创建记录及注意事项

vue-electron 项目创建记录及注意事项 1、使用vue ui或者命令行创建vue项目 2、添加electron插件 3、安装element-plus: npm install --save element-plus 4、修改配置文件如下图: vue.config.js增加配置&#xff1a; pluginOptions:{ electronOutput: { contextIsolation…