Lucas S.
Lucas S.

Reputation: 547

Node.js Web Application running in Windows Azure Emulator

I've been trying Node.js running in Windows Azure Emulator, but unfortunatelly it isn't working. Of course, I started from beginning, Hello World application, following steps in this tutorial.

I followed the steps below with 4 different computers and in all cases the page didn't show anything.

Here, my application was created with the code above:

var http = require('http');
var port = process.env.port || 1337;
http.createServer(function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello World\n');
}).listen(port);

Now I was supposed to see my hello world page. The question is, if somebody had success with the given tutorial? And what Am I doing wrong?

Upvotes: 1

Views: 1304

Answers (3)

Daniele Midi
Daniele Midi

Reputation: 56

I had your exact same error and looking for a long time on the Internet I found this post.

Just to summarize, the problem is that there's a script inside Node package for Azure that's trying to grant permissions for "Network Service" to the web root directory. However my system language is it-IT, so I don't have a user called "Network Service".

So you need to edit the script. If your application path is C:\node\tasklist then the script is located at

C:\node\tasklist\local_package.csx\roles\WebRole1\approot\bin\setup_web.cmd

Just change this line:

icacls ..\ /grant "Network Service":(OI)(CI)W

with this:

icacls ..\ /grant "NetworkService":(OI)(CI)W

This worked for me!

Upvotes: 4

Neil Mackenzie
Neil Mackenzie

Reputation: 2847

You can try running the example directly in node using:

node server.js

and pointing a browser to http://localhost:1337. This takes the Windows Azure emulator out of the picture and might indicate if there is something else going on.

Upvotes: 1

normalian
normalian

Reputation: 53

I think your case is similar with below article. http://blogs.msdn.com/b/avkashchauhan/archive/2012/01/31/handling-two-known-issues-with-windows-azure-node-js-sdk-0-5-2.aspx

I hope you can solve the problem by this info.

Upvotes: 0

Related Questions