Not a valid win32 application on windows 10, VS2015
ghusse opened this issue · 9 comments
Hi,
I'm having trouble making sharp work on windows 10. I managed to build it, using VS 2015.
I installed sharp using npm install --arch=ia32 --msvs_version=2015 sharp
. The build passed.
Once I launch my app, doing a require('sharp')
I get this error:
module.js:355
Module._extensions[extension](this, filename);
^
Error: %1 is not a valid Win32 application.
Any idea?
Bonjour Guillaume. Are you able to try the --msvs_version=2013
flag to generate a MSVC2013 style .vcxproj file that should still be understood by MSVC2015?
This is what the Windows-based CI tasks use with MSVC2015 - see https://github.com/lovell/sharp/blob/master/appveyor.yml#L28
Hi, Thanks for your answer.
It does not work for compiling: I had to change this flag to --msvs_version=2015
in order to successfully install it with NPM.
Otherwise I got an error (I'll copy/paste it later, I don't have access to this computer at this moment).
Which version of node-gyp
are you using? Running npm list -g node-gyp
should provide this. I think at least v2 is required for MSVC2015.
I'm using node-gyp v2.0.2
Le 9 sept. 2015 12:15 PM, "Lovell Fuller" notifications@github.com a
écrit :
Which version of node-gyp are you using? Running npm list -g node-gyp
should provide this. I think at least v2 is required for MSVC2015.—
Reply to this email directly or view it on GitHub
#264 (comment).
I've done some testing and, as long as you're not using Node.js v0.10, it looks like the --msvs_version
flag is not required for machines with only one version of MSVC installed - see https://ci.appveyor.com/project/lovell/sharp/build/165
Quick thought: could you have previously/accidentally installed a 64-bit version of sharp
globally that is being picked up when you require('sharp')
instead of the local 32-bit version?
As far as I can tell, just doing npm install sharp
was not working. But I don't remember if the flag --arch=ia32
alone did the job. I remember an error message telling that building for x64 was not supported yet, if I removed the ia32
flag.
I tried to install sharp without flags first, but as the build failed I searched some help on the installation instructions. All my tries were local, I did not launched a global install.
I installed node recently on this machine, I'm pretty sure it's not v0.10.
Are you using the x86 or x64 version of Node.js? The former is currently supported, the latter is not and is covered by #224.
I remove nodejs, and reinstalled the x32 version (v4.0.0 by the way), launched an install with only --arch=ia32
and it works.
Thanks a lot!
Great, glad to hear you got it working.