在azure 32bit上安装nodejs

时间:2016-08-23 20:42:45

标签: node.js azure node-gyp

我正在尝试将node.js项目部署到Azure Web Apps(免费套餐),其中一个依赖项很明显:https://github.com/lovell/sharp

在完成部署过程后,我得到:

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)

我已经尝试运行在线Azure控制台curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -中的尖锐文档中列出的命令(我尝试删除了sudo,因为Azure并不喜欢这样)。但是我收到了一个错误:

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

所以似乎没有任何工作。不幸的是,我无法将我的环境切换到x64,因为看起来免费层用户被限制在32位环境中。我能用这种方式工作吗?

谢谢!

1 个答案:

答案 0 :(得分:2)

  

虽然大多数模块只是纯文本JavaScript文件,但某些模块是特定于平台的二进制映像。这些模块在安装时编译,通常使用Python和node-gyp   Azure App Service不支持所有本机模块,并且可能无法编译具有非常特定先决条件的模块。

说明来自https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/

您可以在本地环境中的Windows 32平台上安装sharp,并使用包含已编译模块的node_modules文件夹将您的应用程序部署到Azure。

您可以参考https://github.com/lovell/sharp/issues/379在32位Windows环境中安装sharp模块。