Closed grumbaut closed 4 years ago
My guess is it's still something to do with NVM and 32 vs. 64-bit. If you're using npm, you can try overriding the target arch with npm install canvas --target_arch=ia32
or x64
(last I checked yarn does not forward flags).
I'm having the same problem...
Tried npm install canvas --target_arch=ia32
and it didn't work for me.
There's not enough info here to troubleshoot, so I'm going to close this for now.
If anyone wants to troubleshoot further, can you please post:
node -p "process.arch"
and
const fs = require("fs");
const path = require("path");
const cnode = path.join(require.resolve("canvas"), "../build/Release/canvas.node");
const fd = fs.openSync(cnode);
const b = Buffer.alloc(4);
fs.readSync(fd, b, 0, 4, 60);
const pe_addr = b.readUInt32LE(0);
fs.readSync(fd, b, 0, 2, pe_addr + 4);
const type = b.readUInt16LE(0);
console.log(type.toString(16));
That will print one of the values here, which should be 8664
(64-bit) or 14c
(32-bit).
@zbjornson I'm having this issue with another library, fs-ext
- my Node installation is 64-bit and so is the binary:
Past that, are there any extra troubleshooting steps that you might have? I understand if you don't have any since this is a different library - but anything helps. Thanks!
Nevermind, node-loader is being really, really dumb
Disregard my previous comment lol
@LoganDark could you share some more info on what was going wrong so I can add it to the installation troubleshooting guide please? There have been quite a few issues opened for "not a valid Win32 application" that weren't due to 64/32-bit mismatches. Maybe some were due to node-loader.
@LoganDark could you share some more info on what was going wrong so I can add it to the installation troubleshooting guide please? There have been quite a few issues opened for "not a valid Win32 application" that weren't due to 64/32-bit mismatches. Maybe some were due to node-loader.
It was fixed by this PR https://github.com/electron-userland/electron-forge/pull/2449 that was just recently merged. Making the patch manually fixes the issue
Issue or Feature
I'm using node-canvas along with PDF.js to transform PDFs into images, as shown in their pdf2png example.
I included this in a command line tool that was built and published on a Mac, and can run it just fine there. However, on Windows, I'm getting the following error:
I'm using NVM and have confirmed that I have a 64-bit version of both Windows and Node installed. I also tested this out using a 32-bit version of Node and am still getting the same errors.
This is a blocker for a few people, so any help would be appreciated.
Steps to Reproduce
Your Environment
npm list canvas
oryarn list canvas
): 2.6.1