abagshaw
abagshaw

Reputation: 6582

Install nodejs sharp on azure 32bit

I am trying to deploy a node.js project to Azure Web Apps (free tier) and one of its dependencies is sharp: https://github.com/lovell/sharp

When going through the deploy process I get:

ERROR: Intel Architecture 32-bit systems require manual installation - please see http://sharp.dimens.io/en/stable/install/
gyp: Call to 'node -e "require('./binding').download_vips()"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (D:\Program Files (x86)\npm\3.10.3\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit    (internal/child_process.js:204:12)

I've tried running the command listed on the sharp documentation in the online Azure console curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash - (I removed the sudo before trying though because Azure didn't like that). But I got an error:

/usr/bin/bash: line 91: type: pkg-config: not found
(23) Failed writing body

So nothing appears to be working. Unfortunately I can't switch my environment to x64 as it appears that free tier users are restricted to the 32bit environment. Any way I can get this working?

Thanks!

Upvotes: 1

Views: 1961

Answers (1)

Gary Liu
Gary Liu

Reputation: 13918

While most modules are simply plain-text JavaScript files, some modules are platform-specific binary images. These modules are compiled at install time, usually by using Python and node-gyp Azure App Service does not support all native modules and might fail at compiling those with very specific prerequisites.

the description is from https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/.

You can install the sharp in windows 32 platform on your local environment, and deploy your application to Azure with the node_modules folder which contains the compiled module.

You can refer to https://github.com/lovell/sharp/issues/379 for install the sharp module on 32-bit Windows environment.

Upvotes: 2

Related Questions