Closed aarongustafson closed 8 years ago
Looking into this. It seems like the error is
Invalid start-up command "NODE_ENV=production node server.js" in package.json. Please use the format "node <script relative path>".
which I've never had an error using commands like that.
I haven't been able to test on Azure. Only Heroku and it works fine there.
I'm an an American Expat living in the Netherlands and it is literally impossible for me to register with Azure (they don't support Dutch banks and I don't have access to my American cell phone number).
Found some other people having an issue with commands like this on Windows node server.js https://github.com/remy/nodemon/issues/184#issuecomment-87378478
Going to try and npm start script of set NODE_ENV=production&& node server.js
I was able to obtain an Azure account with the help of someone back in the πΊπΈ
I know Azure didn't like the NODE_ENV=production
so I removed that and added a web.config
. Now Azure is bombing on installing the lwip
module. See https://github.com/EyalAr/lwip/issues/79
I did a test removing lwip from package.json
to see if it would deploy ok on Azure. It did, but of course the server crashes with out.
I've contacted Azure support via Twitter.
Native modules are not supported with Azure Webites https://github.com/EyalAr/lwip/issues/79#issuecomment-64981665
Yikes. Might need to check in the node_modules folder? π’
Checking in node_modules made the deploy work but the server crashes. Doing more research
While most modules are simply plain-text JavaScript files, some modules are platform-specific binary images. These modules are compiled at install time, usually by using Python and node-gyp. Since Azure Cloud Services rely on the node_modules folder being deployed as part of the application, any native module included as part of the installed modules should work in a cloud service as long as it was installed and compiled on a Windows development system.
Azure App Service does not support all native modules and might fail at compiling those with very specific prerequisites. While some popular modules like MongoDB have optional native dependencies and work just fine without them, two workarounds proved successful with almost all native modules available today:
Run npm install on a Windows machine that has all the native module's prerequisites installed. Then, deploy the created node_modules folder as part of the application to Azure App Service. Azure App Service can be configured to execute custom bash or shell scripts during deployment, giving you the opportunity to execute custom commands and precisely configure the way npm install is being run. For a video showing how to do this, see Custom Website Deployment Scripts with Kudu.
Sounds like I need to build node_modules on a Windows machine? That kind of confuses me because isn't that what Azure is? A Windows machine?
@aarongustafson This Azure deployment issue has been addressed by switching from lwip
to node-lwip
in https://github.com/jpdevries/makeanico/commit/d6298de06feaa3c75ceb724dc8a50e79333a1856
Ready for another test.
ps: Unfortunately there are still Azure/Edge related issues #5
The TL;DR is
So it runs nows. The deployment doesn't break. But unless there is some way to configure Azure to support larger URLs, the hosting environment does not fully support the app. If you color every cell you won't be able to refresh, save, share, export the art-board in any browser.
When hosted in other environments such as Heroku the web app works fine with lengthly URLs with the exception that Edge does not support them #5.
π Fixed the Azure breaking on large URLs issues in https://github.com/jpdevries/makeanico/commit/de72a0df9fb6cc47dbee57dd4cfb974921f71511
That was a scary one π»
Added https redirect for Azure in https://github.com/jpdevries/makeanico/commit/0ee3ea4792c33621307da19bc9e57db89fcdfcec
This makes sure HTTP/2 and service workers are a go π
@aarongustafson I've tagged a release that is ready for another Azure deployment test with a summary of what was wrong and fixed https://github.com/jpdevries/makeanico/releases/tag/1.0.1-pl