imagemagick安装调用报错command failed

简介: 记录下通过nodejs调用imagemagick 的时候发现的一个错误,command failed -- crop .
在使用gm 或者 imagemagick 的时候发生的问题。

安装的时候,是从网上各种查找,各种安装,各种尝试,最后行了。
但是,往服务器上部署的时候,需要重来一遍...哪里还记得,只能一点一点的排错查找。

windows 安装

把项目直接打包扔上去后,先出的错误就是" command failed -- crop"这样的,nodejs社区找了好多,都说安装6.2版本的,去官网找了一段时间也没找到(手动尴尬)。

选择第一个

最后找到的问题是,安装7的时候,不能选择默认安装,要把“install legacy utilities(e.g. convert) ”选项勾上才可以。

一试之下,果然可以...

此处记录一下。

参考文章:https://blog.csdn.net/taoerchun/article/details/50354362

顺便记录下,项目部署到windows服务器上的步骤:

1.将本地编译好的module,全部打包,直接扔到服务器。(千万不要只打js啥的,因为里面有node canvas已经编译过了)

2.然后在windows服务器上,安装imagemagick 软件。

3.启动,尝试是否报错。

linux 安装

参考文档:
https://imagemagick.org/script/install-source.php

首先需要安装依赖模块

yum install libjpeg-devel.x86_64 libpng-devel.x86_64 glib2-devel.x86_64 fontconfig-devel.x86_64 zlib-devel.x86_64 libwmf-devel.x86_64 freetype-devel.x86_64 libtiff-devel.x86_64

下载文件

 wget https://download.imagemagick.org/ImageMagick/download/ImageMagick.tar.gz

网速慢的话,可以下载后再上传

解压并编译

tar -xzvf ImageMagick.tar.gz 
cd ImageMagick-7.1.0-28/
# 如果需要其他配置,可以查看官网,目前我使用的是默认的,后续有用到再来修改
./configure 
make
make install

查看安装成功

convert --version

安装完成

相关文章
|
2月前
pip install -U weditor 安装报错 error: subprocess-exited-with-error
pip install -U weditor 安装报错 error: subprocess-exited-with-error
193 0
|
2月前
|
测试技术 iOS开发 Perl
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
19 0
|
9月前
|
数据可视化 Python
常见的bug---5、在安装superset时候报错,Command “python setup.py egg_info“ failed with error code 1
常见的bug---5、在安装superset时候报错,Command “python setup.py egg_info“ failed with error code 1
|
2月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
|
11月前
|
C语言
安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
392 0
|
12月前
|
C++ Python
【Python学习笔记】pip安装reportlab包时报错:fatal error LNK1158: cannot run ‘rc.exe‘
【Python学习笔记】pip安装reportlab包时报错:fatal error LNK1158: cannot run ‘rc.exe‘
在处理时有错误发生: trousers tpm-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
在处理时有错误发生: trousers tpm-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
在处理时有错误发生: trousers tpm-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
遇到错误怎么办:ndk-build.cmd‘‘ finished with non-zero exit value 2
遇到错误怎么办:ndk-build.cmd‘‘ finished with non-zero exit value 2
364 0
|
Android开发
INSTALL_FAILED_TEST_ONLY的解决办法
INSTALL_FAILED_TEST_ONLY的解决办法
211 0
成功解决ERROR: Command errored out with exit status 1: command: 'f:\program files\python\python36\pyt
成功解决ERROR: Command errored out with exit status 1: command: 'f:\program files\python\python36\pyt