I'm experimenting with Azure Functions. I'm trying to use a third-party Node module in my function. However, I've been unable to figure out how to import it.
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"requestId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"statusCode": 500,
"errorCode": 0,
"messsage": "Exception while executing function: Functions.analyze -> Error: Cannot find module 'moment'\n at Function.Module._resolveFilename .."
}
I'm just trying to import the moment.js Node library. I was unable to find any documentation around this scenario though.
Does anyone know how to import a third-party module into Azure Functions?

cd into your function directory via Debug console (CMD or PowerShell) and run the command: npm install moment.
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