I'm trying to build an application with fabric.js on node server. I followed the documented steps and i was able to set the canvas and fabric modules.
When i tried to include support for jpeg files by updating the binding.gyp file, the node.canvas breaks.
Current Configuration
v8: '5.1.281.83'
node@6.6.0
node-gyp@3.8.0
npm: '6.4.0-next.0'
Canvas pre-requisite versions
GTK - gtk+-bundle_2.22.1-20101229_win64
jpeglib - libjpeg-turbo-2.0.0-vc64
Installation Steps
npm i canvas
canvas project builds successfully without any errors
I updated binding.gyp in "node_modules/canvas" folder with the following
'with_jpeg%': 'true',
'libjpeg_root%': 'C:/libjpeg-turbo64',
updated the condition
['with_jpeg=="true"', {
'defines': [
'HAVE_JPEG'
],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(libjpeg_root)/bin/jpeg62.dll',
]
}],
'libraries': [
'-l<(libjpeg_root)/lib/jpeg.lib'
],
'include_dirs': [
'<(libjpeg_root)/include'
]
}, {
'libraries': [
'-ljpeg'
]
}]
]
}]
after updating the binding file node-gyp rebuild works fine without any issues and once done if i run the test
Test Canvas Code
var Canvas = require('canvas');
On running the test code i get the following error
Error: The specified module could not be found.
\\?\C:\<AppPath>\node_modules\canvas\build\Release\canvas.node
at Error (native)
If i set with_jpeg variable to false and rebuild the test code works fine without any issue. I'm not quite sure about where i'm going wrong. Can somebody please help me to get this issue resolved.