Hi there, I am trying to run sharp on a windows app service running on 64 bit and I am getting the below error. I have then tried running on a 32-bit OS and the error remains. Any ideas of what this can be caused by?
Error: \\?\D:\home\site\wwwroot\node_modules\sharp\build\Release\sharp.node is not a valid Win32 application\\?\D:\home\site\wwwroot\node_modules\sharp\build\Release\sharp.node
at Object.Module._extensions..node (module.js:672:18)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\sharp\lib\constructor.js:10:15)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
Hello, only x64 node.exe is supported on Windows. Was the same platform used at npm install time as well as runtime?
I made sure the app service is running on node iis 64 binary, and I am using linux to create the artifacts. So my linux agent runs yarn install, creates the artefacts, zips it and deploys it to a windows web app.
My linux agent is running on 64bit.
The yarn install command must be run on Windows if the resultant node_modules is to be used on Windows at runtime.
I tried running straight from the hosting Windows machine and now I am getting another error:
D:\home\site\wwwroot>yarn
yarn install v1.6.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error D:\home\site\wwwroot\node_modules\sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: D:\home\site\wwwroot\node_modules\sharp
Output:
ERR! sharp Intel Architecture 32-bit systems require manual installation of libvips >= 8.6.1
ERR! sharp
ERR! sharp Please see http://sharp.pixelplumbing.com/page/install
'node-gyp' is not recognized as an internal or external command,
operable program or batch file.
Tried installing node-gyp just to check if this was the issue and I am getting:
error D:\home\site\wwwroot\node_modules\sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: D:\home\site\wwwroot\node_modules\sharp
Output:
ERR! sharp Intel Architecture 32-bit systems require manual installation of libvips >= 8.6.1
ERR! sharp
ERR! sharp Please see http://sharp.pixelplumbing.com/page/install
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp http GET https://nodejs.org/download/release/v8.9.4/node-v8.9.4-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v8.9.4/node-v8.9.4-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v8.9.4/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v8.9.4/win-x86/node.lib
gyp http GET https://nodejs.org/download/release/v8.9.4/win-x64/node.lib
gyp http 200 https://nodejs.org/download/release/v8.9.4/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v8.9.4/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v8.9.4/win-x64/node.lib
gyp info spawn D:\Python27\python.EXE
gyp info spawn args [ 'C:\\DWASFiles\\Sites\\#1glmediaapi\\AppData\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'D:\\home\\site\\wwwroot\\node_modules\\sharp\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\DWASFiles\\Sites\\#1glmediaapi\\AppData\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\\local\\UserProfile\\.node-gyp\\8.9.4\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=D:\\local\\UserProfile\\.node-gyp\\8.9.4',
gyp info spawn args '-Dnode_gyp_dir=C:\\DWASFiles\\Sites\\#1glmediaapi\\AppData\\npm\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=D:\\local\\UserProfile\\.node-gyp\\8.9.4\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\\home\\site\\wwwroot\\node_modules\\sharp',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'D:\\home\\site\\wwwroot\\node_modules\\sharp\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn msbuild
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
VError.cpp
..\src\libvips\cplusplus\VError.cpp(33): fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory [D:\home\site\wwwroot\node_modules\sharp\build\libvips-cpp.vcxproj]
VInterpolate.cpp
..\src\libvips\cplusplus\VInterpolate.cpp(34): fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory [D:\home\site\wwwroot\node_modules\sharp\build\libvips-cpp.vcxproj]
VImage.cpp
..\src\libvips\cplusplus\VImage.cpp(41): fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory [D:\home\site\wwwroot\node_modules\sharp\build\libvips-cpp.vcxproj]
win_delay_load_hook.cc
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\DWASFiles\Sites\#1glmediaapi\AppData\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "D:\\Program Files (x86)\\nodejs\\8.9.4\\node.exe" "C:\\DWASFiles\\Sites\\#1glmediaapi\\AppData\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\sharp
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Are you sure this Windows machine is running x64 (64-bit) node.exe? The presence of x86 (32-bit) in D:\\Program Files (x86)\\... suggests otherwise.
@missbruni Were you able to make any progress with ensuring 64-bit host and executables are being used?
Closing due to inactivity but please feel free to re-open if this problem persists on 64-bit Windows.
@lovell I spent several hours trying to get this working last night but Azure functions seems to be locked to 32 bit Node. If you're running a full Azure App Service plan with IIS you can configure which Node it runs (with a nodeProcessCommandLine parameter), but that doesn't seem possible in the slimmer 'Azure Functions' environment.
For me it was more an academic exercise (to essentially make a microservice with what would amount to pennies running cost), but I had to give up in the end. I still have a full VM running that I can do whatever I want on so there's no issue.
Perhaps if you could maintain some kind of 'definitely supported' and 'definitely not supported' page, with brief explanations of why something isn't possible that would be really helpful.
Please see #379 for more context.
I have the same issue. I'm running this on Windows 10 with 64 bit.
Most helpful comment
I have the same issue. I'm running this on Windows 10 with 64 bit.