https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#dependency-management
At section linked above, its suggested to add a package.json file, and then locally install my packages and then push my node_modules directory with my project? What if I'm using source control and git deployments in azure? Do I have to maintain a seperate branch with all these node modules installed? That seems like a lot of extra effort... OR will the node modules install automatically if the package.json is included with the deployment.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi @timmyreilly Thank you for your feedback! We will investigate and get back to you with our findings.
@timmyreilly When deploying functions from source control, any folder with package.json present in your repo will trigger an npm install in that folder.
Since each package.json would trigger an npm install, it is best to have a single package.json at the root of your function app with all the dependencies for all your functions there.
In case you need a package of a specific version for one function, then you can place an extra package.json in the folder for that particular function with just the one package of different version.
Thank you @PramodValavala-MSFT, would you like me to submit a PR to the docs with this information? Or is there additional information users should be aware of?
@timmyreilly Thanks for the offer! We have updated the docs with a note mentioning the same.
We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.
Most helpful comment
@timmyreilly Thanks for the offer! We have updated the docs with a note mentioning the same.
We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.