In order to do some image processing using the Node library, Sharp, I had to upgrade my node executable on Azure App Service to 64-bits. I did this by downloading the executable manually and then setting its path in IISNode.yml
.
Unfortunately, when I start the app, it throws the following error:
Application has thrown an uncaught exception and is terminated: Error: %1 is not a valid Win32 application.
\\?\D:\home\site\wwwroot\node_modules\bcrypt\build\Release\bcrypt_lib.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function.cls_wrapMethod [as _load] (D:\home\site\wwwroot\node_modules\newrelic\lib\shimmer.js:256:38)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (D:\home\site\wwwroot\node_modules\bindings\bindings.js:76:44)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\bcrypt\bcrypt.js:3:35)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function.cls_wrapMethod [as _load] (D:\home\site\wwwroot\node_modules\newrelic\lib\shimmer.js:256:38)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\bookshelf-bcrypt\index.js:5:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
I'm building and deploying the application using the Appveyor CI system. Here's my the relevant portion of my appveyor.yml
file:
install:
- ps: Install-Product node $env:nodejs_version x64
- SET CL=-DDELAYIMP_INSECURE_WRITABLE_HOOKS
- npm i --loglevel=warn
- npm prune --production
- 7z a api.zip * -x!test -x!db -x!.git -xr!.* -x!README.md -x!nodemon.json -x!appveyor.yml | FIND /V "ing "
You'll see that I'm building using a 64-bit version of Node.
On my Azure app service, I have the platform set to 64-bit.
Things I've tried:
- Setting the platform to 32-bit on Azure
- Blowing away node_modules/ on App Service
Thanks in advance!