azure emulator not starting for web role if node_modules directory exists

空扰寡人 提交于 2020-01-13 16:18:42

问题


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?


回答1:


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\" 



回答2:


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 :-)



来源:https://stackoverflow.com/questions/22024861/azure-emulator-not-starting-for-web-role-if-node-modules-directory-exists

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!