3

I think I just stumbled on a really weird problem. I have a pretty big solution including one azure project with 3 roles, two worker and one web role. The web role is based on asp.net mvc and web api. After experimenting with gulp yesterday (for compiling and bundling less files), I noticed just now that the azure emulator won't start this role anymore. The emulator start dialog just stops at ~ 80% and stays there forever, without any error messages. After I removed the node_modules directory, everything worked fine again.

The web role itself doesn't use anything nodejs related, but gulp seems to need the node_modules directory there. Is this a weird bug of the emulator or is that expected behaviour I just don't understand?

Pharao2k
  • 685
  • 4
  • 24
  • Ran into this exact same issue. Have you found a solution? – Sujesh Arukil Aug 28 '14 at 17:50
  • well, in a way, I just moved the node_modules directory from outside the project directory inside the solution directory (so just one node up in the directory tree). – Pharao2k Oct 03 '14 at 11:59
  • I wish I'd have found this question yesterday, as it has been causing me grief for hours! Surely this is a bug with the emulator? – gerrod Oct 16 '14 at 00:14
  • 1
    I guess .. I can't remember if I tried to deploy it to azure to test it there aswell, but I'd guess no since I wouldn't deploy something that doesn't even work locally. But it did cost me hours, too, to find this and find the mentioned workaround :/ – Pharao2k Oct 16 '14 at 13:13
  • Just thought I'd chime in and say I'm having the exact same issue. It took me hours to find the cause, because when starting the emulator, the Azure Compute emulator starts, and then shuts down immediately with this useless error message: "The program '[5492] WaIISHost.exe' has exited with code 0 (0x0)." – romiem Dec 07 '14 at 21:19
  • Also, the reason why Pharao2k's solution works is because node recursively searches up the folder hierarchy until it finds a node_modules folder - as explained here: http://stackoverflow.com/questions/18974436/change-node-modules-location – romiem Dec 07 '14 at 21:22

2 Answers2

2

I temporally solved this by including Pre-build and Post-build event.

Pre-Build event: npm install

Post-Build event: rmdir /s /q "$(ProjectDir)node_modules\" 
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
0

Have you tried making the "node_modules" folder hidden?

I had a similar issue where visual studio was crashing. It came down the paths of some files in the node_modules folder being greater than 260 characters

I'm not saying this will work for you, as I haven't had your exact issue, but as Visual Studio doesn't load hidden folders... it just might work :-)

image

Thwaitesy
  • 1,503
  • 2
  • 13
  • 15
  • Interesting idea, though I won't test it as I am currently satisfied with the solution of having the node_modules directory inside the solution directory (as mentioned in the upper comments) ... but I like the idea to use the hidden flag as a workaround for the 260 character limit, as the git integration really doesn't like that. – Pharao2k Apr 22 '15 at 09:51