简体   繁体   中英

Node.js on Azure Website 500 status

I am trying to get a node.js (meanjs) site running on Azure. The site work on my local environment with no errors. But after deployment when I go to my site I get a 500 error in my network tab in chrome. There are no obvious errors to me.

I used https://groups.google.com/forum/#!topic/meanjs/LrHmE43RSvA to walk me through how to set it up with the azure cli.

It is also setup to deploy form my github.

In the Azure portal the deployment dose not fail. I have read through the log and tried to find a problem but im hardly know where to start. Reading through it there are some things that look weird to me for instance. (The log is long and past the character limit or I would have posted it all.)

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\\repository\\node_modules\\bson\\build\\binding.sln]

and there are lots of

npm WARN unmet dependency

Then they all get processed and the files get copped to the wwwroot and finishes successfully.

Some of the things i have tried are changing the deployment branch, deleting the website and starting over. I have

Let me know if there is any thing else that I can add to this post I really want to get this working.

Thanks for any help.

Edit**

I added bson to the .gitignore and got a new error. I am also getting some new errors below is what has changed.

bson@0.2.18 install D:\\home\\site\\repository\\node_modules\\bson (node-gyp rebuild 2> builderror.log) || (exit 0)

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\\repository\\node_modules\\bson\\build\\binding.sln]

npm WARN prefer global coffee-script@1.8.0 should be installed with -g npm ERR! Error: ENOENT, chmod >'D:\\home\\site\\repository\\node_modules\\flatiron\\bin\\flatiron'

npm ERR! If you need help, you may report this entire log,

I also added a .npmignore to the directory but it is blank. I have tried adding both the bson and flatiron to the .gitignore but that did not change the error.

From the log you posted, I can see it failed when azure tried to install an NPM module named bson during the deployment, because there's no VC++ compiler in the virtual machine your azure website located.

It worked well in your machine since you have VC++ installed.

To fix, you'd better compile this module ( bson ) in your machine (x86 or x64 based on which one selected in your azure website), make this module as included under node_modules folder in your .gitignore so that it will be uploaded when you commit your code.

I have a blog post mentioned this problem and I was using Node.js SQL Server Driver as an example. It also needs VC++ compile. http://blog.shaunxu.me/archive/2012/11/16/install-npm-packages-automatically-for-node.js-on-windows-azure-web.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM