Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I omit node_modules from Azure mobile services repo?

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
like image 389
Mike Marshall Avatar asked Jan 19 '26 21:01

Mike Marshall


1 Answers

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.

like image 94
carlosfigueira Avatar answered Jan 22 '26 11:01

carlosfigueira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!