I'm writing an Windows Azure Mobile Services background job. If I use node.js modules other than the defaults provided by Azure, can I omit the node_modules folder when committing to my Azure git repo if I have a root package.json? Will Azure download those packages automatically?
Update: For clarification, I have the following repo (sorry, this is from memory, don't have it in front of me)
> <root repo dir>
> \service
> \api
> \scheduler
> \node_modules
> \npmmodule1
> \npmmodule2 .. etc
> package.json <-- generated with npm init
> myJob.js
I'm asking if the following is sufficient for commit and deploy
> <root repo dir>
> \service
> \api
> \scheduler
> package.json <-- generated with npminit
> myJob.js
No. Currently, Azure Mobile Services does not pull the any modules from NPM based on the presence of a package.json file. You need to npm install the modules in your local Git clone, git add the node_modules folder in your repository and push the changes to the server.
Supporting npm package restore (via package.json) is a feature which is in the backlog to be implemented. I'd suggest you create a feature request on the Azure Mobile Services UserVoice, so it can be prioritized accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With