1

I have a Node JS function. I'm running Azure Functions Core Tools with VS Code for local debugging.

I have a few dependencies in my node_modules folder which is at root level.

FunctionsProject
| - MyFunction
| | - index.js
| | - function.json
| - node_modules
| - package.json

I then attempt to deploy directly from VSCode using the Azure extension, but only the index.js and function.json files are getting included with my function.

What is the best way to have my node_modules included in the deployment from VSCode?

Thanks

Tester_123
  • 55
  • 1
  • 7

1 Answers1

2

The node_modules directory can be very large so it is not included when you deploy your application. Instead, you can use Kudu (https://<function_app_name>.scm.azurewebsites.net) to run npm install to install all packages that are part of your package.json.

Also see Dependency management for more information.

Martin Brandl
  • 56,134
  • 13
  • 133
  • 172