无法通过CLI部署Azure功能

时间:2020-07-14 17:39:21

标签: node.js azure azure-functions command-line-interface azure-deployment

我正在尝试使用此命令将我的Azure函数部署到函数应用程序。 func azure functionapp publish cost-and-usage-functions-function-app --force 这个确切的行昨天正常工作,但是现在每次运行它时,都会出现此错误。我还要提及的是,运行func azure functionapp publish昨天大约工作了一半,另一半时间它停滞了,什么也不做,我不知道为什么,但现在根本无法使用。 >

events.js:287
      throw er; // Unhandled 'error' event
      ^

Error: spawn /usr/local/lib/node_modules/azure-functions-core-tools/bin/func EACCES
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'EACCES',
  code: 'EACCES',
  syscall: 'spawn /usr/local/lib/node_modules/azure-functions-core-tools/bin/func',
  path: '/usr/local/lib/node_modules/azure-functions-core-tools/bin/func',
  spawnargs: [
    'azure',
    'functionapp',
    'publish',
    'cost-and-usage-functions-function-app',
    '--force'
  ]
}

我要做的就是通过cli将5个功能部署到功能应用程序中,我可以解决此问题,也可以选择其他cli部署方法。我已经尝试删除节点模块并重新运行npm install,但这没有用。任何帮助将不胜感激,谢谢。

1 个答案:

答案 0 :(得分:0)

因此,卸载npm azure cli然后重新安装它可以解决我在此问题中描述的问题。该命令仍然不一致,有时似乎出于某种原因只是超时,但此特定问题已解决。