-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: node-canvas was built without JPEG support #1782
Comments
You should install a program named "libjpeg-turbo". |
Thank you! I read the code for binding.gyp. An error was reported when it runs the command with "node ./util/has_lib.js jpeg". So I force the variable of "with_jpeg" to true, then run width node-gyp configure build, problem resolved. Your way, I will try it! |
Thing is, it looks like that I've checked it on the older Mac with 10.14, libjpeg gets linked into Also |
I'm having this problem on my M1 too =/ |
I'm having same issue with jpeg (png works well). (apple m1) Canvas.toDataURL with mime type image/jpeg, inside Canvas.toBuffer return undefined. (canvas/lib/canvas.js line 111). Stack: |
Should compile after that. |
This didn't work for me. Do I need to run some other command? |
Adding this into export LDFLAGS="-L /opt/homebrew/lib"
export CPPFLAGS="-I /opt/homebrew/include" |
I had the same issue:
The above mentioned installs/steps did not solve it for me using Apple M1 Pro. SOLUTION: Pull the latest version of node-canvas straight from github! (Issues was fixed in PR #1910).Hopefully we can have an official release with the M1 fixed issues soon! Thanks for the good work. |
@david-sabata how did you add this? Is there a certain folder did you go to using terminal and then run the command? sorry for the noob question. |
hey @NikyPeng, how do you run width node-gyp configure build ? |
const image = await loadImage(imageUrl); console.log('image content: ', image); no response if i put a jpg image url? please guide me further System: Macbook M2 Pro/ macOS Sonoma 14.0 (23A344) |
Issue or Feature
/Users/pengcheng/pc/canvas/node_modules/canvas/lib/image.js:91
SetSource.call(img, src);
^
Error: node-canvas was built without JPEG support
at setSource (/Users/pengcheng/pc/canvas/node_modules/canvas/lib/image.js:91:13)
at Image.set (/Users/pengcheng/pc/canvas/node_modules/canvas/lib/image.js:62:9)
at /Users/pengcheng/pc/canvas/node_modules/canvas/index.js:34:15
at new Promise ()
at loadImage (/Users/pengcheng/pc/canvas/node_modules/canvas/index.js:23:10)
at Object. (/Users/pengcheng/pc/canvas/index.js:19:1)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
Steps to Reproduce
Your Environment
npm list canvas
oryarn list canvas
): canvas@2.7.0The text was updated successfully, but these errors were encountered: