galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.15k stars 170 forks source link

Error when deploying to Azure #198

Open JensWinter opened 7 years ago

JensWinter commented 7 years ago

Hi there,

unfortunately I failed deploying my app to Azure. It makes use of the great HummusJS library. Everything works fine on my development machine - a MacBook Pro.

When I deploy to an azure web app I get the following error:

Failed exitCode=1, command="D:\Program Files (x86)\nodejs\6.11.2\node.exe" "D:\Program Files (x86)\npm\3.10.10\node_modules\npm\bin\npm-cli.js" install --production An error has occurred during web site deployment. node-pre-gyp ERR! Tried to download: https://hummus.s3-us-west-2.amazonaws.com/hummus/v1.0.81/node-v48-win32-ia32.tar.gz \r\nnode-pre-gyp ERR! Pre-built binaries not found for hummus@1.0.81 and node@6.11.2 (node-v48 ABI) (falling back to source compile with node-gyp) \r\ngyp ERR! build error \r\ngyp ERR! stack Error: msbuild failed with exit code: 1\r\ngyp ERR! stack at ChildProcess.onExit (D:\Program Files (x86)\npm\3.10.10\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)\r\ngyp ERR! stack at emitTwo (events.js:106:13)\r\ngyp ERR! stack at ChildProcess.emit (events.js:191:7)\r\ngyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)\r\ngyp ERR! System Windows_NT 6.2.9200\r\ngyp ERR! command "D:\Program Files (x86)\nodejs\6.11.2\node.exe" "D:\Program Files (x86)\npm\3.10.10\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=D:\home\site\wwwroot\node_modules\hummus\binding\hummus.node" "--module_name=hummus" "--module_path=D:\home\site\wwwroot\node_modules\hummus\binding"\r\ngyp ERR! cwd D:\home\site\wwwroot\node_modules\hummus\r\ngyp ERR! node -v v6.11.2\r\ngyp ERR! node-gyp -v v3.4.0\r\ngyp ERR! not ok \r\nnode-pre-gyp ERR! build error \r\nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=D:\home\site\wwwroot\node_modules\hummus\binding\hummus.node --module_name=hummus --module_path=D:\home\site\wwwroot\node_modules\hummus\binding' (1)\r\nnode-pre-gyp ERR! stack at ChildProcess. (D:\home\site\wwwroot\node_modules\hummus\node_modules\node-pre-gyp\lib\util\compile.js:83:29)\r\nnode-pre-gyp ERR! stack at emitTwo (events.js:106:13)\r\nnode-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)\r\nnode-pre-gyp ERR! stack at maybeClose (internal/child_process.js:891:16)\r\nnode-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)\r\nnode-pre-gyp ERR! System Windows_NT 6.2.9200\r\nnode-pre-gyp ERR! command "D:\Program Files (x86)\nodejs\6.11.2\node.exe" "D:\home\site\wwwroot\node_modules\hummus\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"\r\nnode-pre-gyp ERR! cwd D:\home\site\wwwroot\node_modules\hummus\r\nnode-pre-gyp ERR! node -v v6.11.2\r\nnode-pre-gyp ERR! node-pre-gyp -v v0.6.29\r\nnode-pre-gyp ERR! not ok \r\nnpm WARN lka-hauspreislisten-server@1.0.0 No description\r\nnpm ERR! Windows_NT 6.2.9200\r\nnpm ERR! argv "D:\Program Files (x86)\nodejs\6.11.2\node.exe" "D:\Program Files (x86)\npm\3.10.10\node_modules\npm\bin\npm-cli.js" "install" "--production"\r\nnpm ERR! node v6.11.2\r\nnpm ERR! npm v3.10.10\r\nnpm ERR! code ELIFECYCLE\r\n\r\nnpm ERR! hummus@1.0.81 install: node-pre-gyp install --fallback-to-build\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the hummus@1.0.81 install script 'node-pre-gyp install --fallback-to-build'.\r\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\r\nnpm ERR! If you do, this is most likely a problem with the hummus package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR! node-pre-gyp install --fallback-to-build\r\nnpm ERR! You can get information on how to open an issue for this project with:\r\nnpm ERR! npm bugs hummus\r\nnpm ERR! Or if that isn't available, you can get their info via:\r\nnpm ERR! npm owner ls hummus\r\nnpm ERR! There is likely additional logging output above.\r\n\r\nnpm ERR! Please include the following file with any support request:\r\nnpm ERR! D:\home\site\wwwroot\npm-debug.log\r\nD:\Program Files (x86)\SiteExtensions\Kudu\65.60901.2996\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

Any ideas on how to resolve this?

Thank you very much!

chunyenHuang commented 7 years ago

try this

[Run as administrator]
npm i -g --production windows-build-tools
npm install --global node-gyp
npm install --global node-pre-gyp
npm i hummus --save
Vishnupriya112 commented 6 years ago

@galkahana Am also facing this same issue. How u fixed that Issue

JensWinter commented 6 years ago

Hi! I solved it by using a Linux machine. I suppose the problem occurs because some of the dependencies are not compatible on Windows environments. My server is currently running on a Linode Ubuntu machine. But it should also work on an Azure Linux server.

Hope that helps.

aathirag commented 6 years ago

I am also getting the same error in CentOS. How can I fix?. In the local machine, I am using ubuntu 14.04 its working fine.

andreyrd commented 6 years ago

Azure App Service does not give the user administrator access, so the windows-build-tools solution will not work.