I'm currently trying to deploy an Express/Node.js app on azure without much success -- the error I'm getting is the following:
remote: > libxmljs@0.9.0 install D:\home\site\wwwroot\node_modules\libxmljs
remote: > node-gyp rebuild
remote:
remote:
remote: D:\home\site\wwwroot\node_modules\libxmljs>node "D:\Program Files (x86)\npm\1.3.11\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
remote: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
remote: MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [D:\home\site\wwwroot\node_modules\libxmljs\build\binding.sln]
remote: gypnpm ERR! weird error 1
remote: Failed exitCode=1, command="D:\Program Files (x86)\nodejs\0.10.21\node.exe" "D:\Program Files (x86)\npm\1.3.11\node_modules\npm\bin\npm-cli.js" install --production
remote: An error has occurred during web site deployment.
remote: npm
I recognize that the Azure instance is failing to compile libxmljs, so I've excluded libxmljs from the .gitignore file, which looks like the following:
!/node_modules/
/node_modules/*
!/node_modules/express/
!/node_modules/libxmljs/
.DS_Store
._*
But that's still not helping at all, I suspect because I'm compiling it on a Mac and trying to upload it to a Windows machine. Does anyone have any wisdom for me? Thanks!
Have you tried removing all /node_modules/ from .gitignore entirely?
Also, if you are using a generated .gitignore file, check for the actual "express" folder being ignored. I had to remove that from a Visual Studio generated .gitignore to get continuous integration working with a node.js app and Azure.
If no amount of .gitignore massaging works, try FTP'ing all of your project files up to the server manually to see if it kicks over. This will tell you if it's an issue with continuous integration/Git or with the actual app and environment.
Edit: On the subject of finicky node.js deployments to Azure I have also experienced trouble due to my app's directory structure.