Azure Function(javascript)中安装依赖包前如何指定registry?

How to specify the registry before installing the dependent packages in Azure Function (javascript)?

我选择了使用 Azure Fcuntion 的本地 Git 部署方法。我的编程语言是 javascript。当我使用 Git 将代码从本地机器上传到 Azure Functions 时, 'node_moudle' 目录没有上传,所以我有几个问题想知道:

  1. 上传代码后'npm install'会执行吗?

  2. 执行'npm install'时,从哪个注册中心拉取依赖包?

  3. 这个过程如何指定注册表?

谢谢。

参考文档:https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies

感谢yonding701的确认。很高兴您的问题已解决并将其作为答案发布以帮助其他社区成员。

为了在您的 JavaScript 中使用这些库,您需要确保所有依赖项都安装在您的函数应用程序上。

下面是安装依赖的示例代码

// Import the underscore.js library
var _ = require('underscore');
var version = process.version; // version === 'v6.5.0'

module.exports = function(context) {
    // Using our imported underscore.js library
    var matched_names = _
        .where(context.bindings.myInput.names, {first: 'Carla'});

查看此 Dependency link 了解更多详情。