如何为 azure nodejs 函数包含 azure sdk?

how to include the azure sdk for azure nodejs functions?

我正在尝试使用 typescript/nodejs 创建一个 azure 函数。我的函数需要写入 BlobService,所以为此我需要安装 sdk。

我发现我必须在函数应用程序的控制台中 运行 'npm install'(这个 link https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node),但是,我收到此错误

D:\home\site\wwwroot> WARN hack2017@1.0.0 No repository field.
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\Program Files (x86)\nodejs\6.5.0\node.exe" "D:\Program Files (x86)\npm\3.10.3\node_modules\npm\bin\npm-cli.js" "install" "azure-asm-storage"
npm ERR! node v6.5.0
npm ERR! npm  v3.10.3
npm ERR! path D:\home\site\wwwroot\node_modules\.staging\lodash-92db4caf
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir

npm ERR! Error: EPERM: operation not permitted, scandir 'D:\home\site\wwwroot\node_modules\.staging\lodash-92db4caf'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, scandir 'D:\home\site\wwwroot\node_modules\.staging\lodash-92db4caf'
npm ERR!     at Error (native)
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'D:\home\site\wwwroot\node_modules\.staging\lodash-92db4caf' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\home\site\wwwroot\npm-debug.log

在 npm-debug.log 我看到这个错误

30798 error tar.unpack untar error D:\local\AppData\npm-cache\azure.0.0-preview\package.tgz

我已经尝试删除 node_modules 文件夹,我已将 package.json 修剪为仅包含一个包,但每次仍然出现相同的错误。

对我可能做错的事情有什么建议吗?

我能够使用 "npm install azure-storage" 通过 Kudu 在主文件夹下安装模块 azure-storage,然后将整个 node_modules 复制到那里的 "home\site\wwwroot" 文件夹。在那之后我的功能似乎需要更长的时间来加载,但是没有更多关于找不到该模块的抱怨。我使用的是标准应用服务计划,而不是消费计划。