Open ramanabhinav7 opened 5 months ago
I am using windows 11 Could not execute GraphicsMagick/ImageMagick: '+cmd+" this most likely means the gm/convert binaries can't be found" i have used npm install imagemagick and npm i gm but still this is showing in windows please help me const { fromPath } = require('pdf2pic');
const options = { density: 100, saveFilename: "untitled", savePath: "", format: "jpeg", width: 600, height: 600 };
const convert = fromPath('invoice.pdf', options); const pageToConvertAsImage = 1;
convert(pageToConvertAsImage, { responseType: "image" }) .then((resolve) => { console.log("Page 1 is now converted as JPEG");
return resolve; }); below is the error cb(new Error('Could not execute GraphicsMagick/ImageMagick: '+cmd+" this most likely means the gm/convert binaries can't be found")); ^
Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "-density" "100x100" "-quality" "75" "-[0]" "-resize" "600x600!" "-compress" "jpeg" "untitled.1.jpeg" this most likely means the gm/convert binaries can't be found at ChildProcess. (C:\Users\ABHINAV KUMAR\Desktop\Node_jsm\innovice_jaishreemahakal\node_modules\gm\lib\command.js:249:12) at ChildProcess.emit (node:events:514:28) at cp.emit (C:\Users\ABHINAV KUMAR\Desktop\Node_jsm\innovice_jaishreemahakal\node_modules\cross-spawn\lib\enoent.js:36:37) at ChildProcess._handle.onexit (node:internal/child_process:294:12)
Node.js v20.9.0
This error happens because GraphicsMagick is not installed on your computer.
For windows users.. open the links and download installers.
Add the executable directories to the PATH environment variable for Ghostscript and GraphicsMagick:
I am using windows 11 Could not execute GraphicsMagick/ImageMagick: '+cmd+" this most likely means the gm/convert binaries can't be found" i have used npm install imagemagick and npm i gm but still this is showing in windows please help me const { fromPath } = require('pdf2pic');
const options = { density: 100, saveFilename: "untitled", savePath: "", format: "jpeg", width: 600, height: 600 };
const convert = fromPath('invoice.pdf', options); const pageToConvertAsImage = 1;
convert(pageToConvertAsImage, { responseType: "image" }) .then((resolve) => { console.log("Page 1 is now converted as JPEG");
return resolve; }); below is the error cb(new Error('Could not execute GraphicsMagick/ImageMagick: '+cmd+" this most likely means the gm/convert binaries can't be found")); ^
Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "-density" "100x100" "-quality" "75" "-[0]" "-resize" "600x600!" "-compress" "jpeg" "untitled.1.jpeg" this most likely means the gm/convert binaries can't be found at ChildProcess. (C:\Users\ABHINAV KUMAR\Desktop\Node_jsm\innovice_jaishreemahakal\node_modules\gm\lib\command.js:249:12) at ChildProcess.emit (node:events:514:28) at cp.emit (C:\Users\ABHINAV KUMAR\Desktop\Node_jsm\innovice_jaishreemahakal\node_modules\cross-spawn\lib\enoent.js:36:37) at ChildProcess._handle.onexit (node:internal/child_process:294:12)
Node.js v20.9.0