zhangyuanwei / node-images

Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Nodejs
https://npmjs.org/package/images
MIT License
1.55k stars 205 forks source link

关于支持node12 的版本大概什么时候会出? #209

Closed kang888888 closed 4 years ago

kang888888 commented 4 years ago

您好,请问大概什么时候会出支持node12 的版本呢?

oxUnd commented 4 years ago

代码都是现成的,可以尝试自己编译。

kang888888 notifications@github.com 于 2020年5月27日周三 下午6:32写道:

您好,请问大概什么时候会出支持node12 的版本呢?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zhangyuanwei/node-images/issues/209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2DG7LA2JBTC6I64LJFHTRTTT45ANCNFSM4NMADMHA .

kang888888 commented 4 years ago

image

c:\test\node-images\gyp\third-party\giflib\lib\gif_hash.h(10): fatal error C1083: 无法打开包括文件: “unistd.h”: No such file or directory (编译 源文件 ......\gyp\third-party\giflib\lib\gif_err.c) [C:\test\node-images\build\gyp\gyp\giflib.vcxproj]

你好,编译时提示我找不到这个文件,这个是缺少了文件吗

kang888888 commented 4 years ago

我后面看网上说是缺了头文件,补了一个,内容如下:

ifndef _UNISTD_H

define _UNISTD_H

include

include

endif / _UNISTD_H /

但还是会报错: C:\test\node-images>node-gyp build gyp info it worked if it ends with ok gyp info using node-gyp@5.1.1 gyp info using node@12.16.3 | win32 | x64 gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe gyp info spawn args [ gyp info spawn args 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' gyp info spawn args ] 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 libpng.vcxproj -> C:\test\node-images\build\Release\libpng.lib libjpeg-turbo.vcxproj -> C:\test\node-images\build\Release\libjpeg-turbo.lib dgif_lib.c gif_err.c c:\test\node-images\gyp\third-party\giflib\lib\dgif_lib.c(383): warning C4018: “<”: 有符号/无符号不匹配 [C:\test\node-images\build\gyp\gyp\gif lib.vcxproj] giflib.vcxproj -> C:\test\node-images\build\Release\giflib.lib zlib.vcxproj -> C:\test\node-images\build\Release\zlib.lib 正在创建库 C:\test\node-images\build\Release\binding.lib 和对象 C:\test\node-images\build\Release\binding.exp giflib.lib(dgif_lib.obj) : error LNK2001: 无法解析的外部符号 reallocarray [C:\test\node-images\build\binding.vcxproj] C:\test\node-images\build\Release\binding.node : fatal error LNK1120: 1 个无法解析的外部命令 [C:\test\node-images\build\binding.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\node\node-v12.16.3-win-x64\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:310:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\node\node-v12.16.3-win-x64\node.exe" "C:\node\node-v12.16.3-win-x64\node_modules\node-gyp\bin\node-gyp.js" "build" gyp ERR! cwd C:\test\node-images gyp ERR! node -v v12.16.3 gyp ERR! node-gyp -v v5.1.1 gyp ERR! not ok

oxUnd commented 4 years ago

reallocarray 看一下是不是被注释了;

kang888888 notifications@github.com 于2020年5月28日周四 下午2:03写道:

我后面看网上说是缺了头文件,补了一个,内容如下: /** This file is part of the Mingw32 package.

  • unistd.h maps (roughly) to io.h

*/ #ifndef _UNISTD_H #define _UNISTD_H #include #include

#endif /* _UNISTD_H */ 但还是会报错: C:\test\node-images>node-gyp build gyp info it worked if it ends with ok gyp info using node-gyp@5.1.1 gyp info using node@12.16.3 | win32 | x64 gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe gyp info spawn args [ gyp info spawn args 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' gyp info spawn args ] 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 libpng.vcxproj -> C:\test\node-images\build\Release\libpng.lib libjpeg-turbo.vcxproj -> C:\test\node-images\build\Release\libjpeg-turbo.lib dgif_lib.c gif_err.c c:\test\node-images\gyp\third-party\giflib\lib\dgif_lib.c(383): warning C4018: “<”: 有符号/无符号不匹配 [C:\test\node-images\build\gyp\gyp\gif lib.vcxproj] giflib.vcxproj -> C:\test\node-images\build\Release\giflib.lib zlib.vcxproj -> C:\test\node-images\build\Release\zlib.lib 正在创建库 C:\test\node-images\build\Release\binding.lib 和对象 C:\test\node-images\build\Release\binding.exp giflib.lib(dgif_lib.obj) : error LNK2001: 无法解析的外部符号 reallocarray [C:\test\node-images\build\binding.vcxproj] C:\test\node-images\build\Release\binding.node : fatal error LNK1120: 1 个无法解析的外部命令 [C:\test\node-images\build\binding.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\node\node-v12.16.3-win-x64\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:310:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\node\node-v12.16.3-win-x64\node.exe" "C:\node\node-v12.16.3-win-x64\node_modules\node-gyp\bin\node-gyp.js" "build" gyp ERR! cwd C:\test\node-images gyp ERR! node -v v12.16.3 gyp ERR! node-gyp -v v5.1.1 gyp ERR! not ok — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or unsubscribe .
kang888888 commented 4 years ago

你好,我这边找了node-images\gyp\third-party\giflib\lib目录下的文件里面好像都没有注释掉reallocarray的地方,是我忽略遗漏了哪个文件吗

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 libpng.vcxproj -> C:\test\node-images\build\Release\libpng.lib libjpeg-turbo.vcxproj -> C:\test\node-images\build\Release\libjpeg-turbo.lib giflib.vcxproj -> C:\test\node-images\build\Release\giflib.lib zlib.vcxproj -> C:\test\node-images\build\Release\zlib.lib 正在创建库 C:\test\node-images\build\Release\binding.lib 和对象 C:\test\node-images\build\Release\binding.exp giflib.lib(dgif_lib.obj) : error LNK2001: 无法解析的外部符号 reallocarray [C:\test\node-images\build\binding.vcxproj] C:\test\node-images\build\Release\binding.node : fatal error LNK1120: 1 个无法解析的外部命令 [C:\test\node-images\build\binding.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\node\node-v12.16.3-win-x64\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:310:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\node\node-v12.16.3-win-x64\node.exe" "C:\node\node-v12.16.3-win-x64\node_modules\node-gyp\bin\node-gyp.js" "build" gyp ERR! cwd C:\test\node-images gyp ERR! node -v v12.16.3 gyp ERR! node-gyp -v v5.1.1 gyp ERR! not ok

kang888888 commented 4 years ago

我在想这个是否还是由于头文件导致的呢,请问大神你这边编译的环境是unix类的系统吗,是否是我这边windows系统编译的问题?

kang888888 commented 4 years ago

你好,我这边发现在third-party/giflib/lib/gif_lib.h文件中reallocarray这个只是声明了,但是没有被实现,这边补了一个实现之后编译通过了,补的实现如下: void reallocarray(void optr, size_t nmemb, size_t size) { return NULL; }

补了之后编译成功了,但是这个会带来什么问题吗,请问原来的项目中这个实现的代码是被去掉了吗:

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 libpng.vcxproj -> C:\test\node-images\build\Release\libpng.lib libjpeg-turbo.vcxproj -> C:\test\node-images\build\Release\libjpeg-turbo.lib dgif_lib.c c:\test\node-images\gyp\third-party\giflib\lib\dgif_lib.c(383): warning C4018: “<”: 有符号/无符号不匹配 [C:\test\node-images\build\gyp\gyp\gif lib.vcxproj] giflib.vcxproj -> C:\test\node-images\build\Release\giflib.lib zlib.vcxproj -> C:\test\node-images\build\Release\zlib.lib 正在创建库 C:\test\node-images\build\Release\binding.lib 和对象 C:\test\node-images\build\Release\binding.exp 正在生成代码 All 1080 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. 已完成代码的生成 binding.vcxproj -> C:\test\node-images\build\Release\binding.node gyp info ok

oxUnd commented 4 years ago

大概更新了一下代码,解决了一些问题,等我近期发布新版;

kang888888 commented 4 years ago

好嘞,大概时间是这两周吗

kang888888 commented 4 years ago

我重新拉master和gyp上的代码重新编译现在是可以先用着了,没报那个reallocarray错误了,坐等大佬更新版本兼容node12

oxUnd commented 4 years ago

64 位系统已支持,32 暂时没有计划;

freekingg commented 3 years ago

linux 什么时候能支持

node: symbol lookup error: /app/imagemin/node_modules/images/vendor/linux-x64-binding.node: undefined symbol: reallocarray