Module version mismatch. Expected 43, got 14. while running node-imagemagick-native sample program

261 Views Asked by At

I installed the node-imagemagick-native using command npm install imagemagick-native The module is successfully installed with the following log

C:\Users\xz\Downloads\test\examples>npm install imagemagick-native

> [email protected] install C:\Users\xz\Downloads\test\examples\node_modules\imagemagick-native
> node-gyp rebuild


C:\Users\xz\Downloads\test\examples\node_modules\imagemagick-native>if not defined npm_config_node_gyp (node "C:\Users\xz\AppData\Roaming\nvm\v0.12.7\node_modules\npm\bin
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  imagemagick.cc
c:\program files\imagemagick-6.8.5-q16\include\magick/pixel-accessor.h(163): warning C4244: 'argument' : conversion from 'double' to 'const MagickCore::MagickRealType',
possible loss of data [C:\Users\xz\Downloads\test\examples\node_modules\imagemagick-native\build\imagemagick.vcxproj]
C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:
\Users\xz\Downloads\test\examples\node_modules\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(131): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(304): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(344): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(364): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(405): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(572): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(742): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(817): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\xz\Downloads\test\examples\node_modu
les\imagemagick-native\build\imagemagick.vcxproj]
..\src\imagemagick.cc(890): warning C4344: behavior change: use of explicit template arguments results in call to 'v8::Local<T> NanNew<v8::String,char*>(A0)' [C:\Users\x
z\Downloads\test\examples\node_modules\imagemagick-native\build\imagemagick.vcxproj]
          with
          [
              T=v8::String,
              A0=char *
          ]
          but the regular function 'v8::Local<T> NanNew(const char *)' is a better match
          with
          [
              T=v8::String
          ]
          if you expect 'v8::Local<T> NanNew(const char *)' to be called then you need to make it an explicit specialization
          with
          [
              T=v8::String
          ]
  win_delay_load_hook.c
     Creating library C:\Users\xz\Downloads\test\examples\node_modules\imagemagick-native\build\Release\imagemagick.lib and object C:\Users\xz\Downloads\test\examples\no
  de_modules\imagemagick-native\build\Release\imagemagick.exp
  Generating code
  Finished generating code
  imagemagick.vcxproj -> C:\Users\xz\Downloads\test\examples\node_modules\imagemagick-native\build\Release\\imagemagick.node
[email protected] C:\Users\xz\Downloads\test\examples
└── [email protected]  extraneous


C:\Users\xz\Downloads\test\examples>

Now after installation, I tried to run the sample program

var imagemagick = require('imagemagick-native');
imagemagick.writeFileSync('image.jpg', imagemagick.convert({
    srcData: fs.readFileSync('before.jpg'),
    format: 'PNG',
    quality: 100 // (best) to 1 (worst)
}));

But got the following error...

enter image description here

Please look into the issue and oblige.

0

There are 0 best solutions below