简体   繁体   English

无法通过 CLI 部署 Azure 功能

[英]Unable to deploy Azure Functions via CLI

I am attempting to deploy my azure functions to a function app using this command.我正在尝试使用此命令将我的 azure 功能部署到 function 应用程序。 func azure functionapp publish cost-and-usage-functions-function-app --force This exact line worked properly yesterday but now every time I run it I get this error. func azure functionapp publish cost-and-usage-functions-function-app --force这条确切的行昨天工作正常,但现在每次运行时都会出现此错误。 I would also like to mention that running func azure functionapp publish worked about half the time yesterday, the other half of the time it would stall out and do nothing and I have no idea as to why but now it never works at all.我还想提一下,昨天运行 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'
  ]
}

All I want to do is deploy 5 functions to a function app via cli, I'm open to any fixes to this problem, alternative cli deployment methods, anything at this point.我想要做的就是通过 cli 将 5 个功能部署到 function 应用程序,我愿意接受任何对此问题的修复,替代 cli 部署方法,此时任何事情。 I've already tried deleting node modules and rerunning npm install and that didn't work.我已经尝试删除节点模块并重新运行npm install ,但没有成功。 Any help would be greatly appreciated thanks in advance.任何帮助将不胜感激提前感谢。

So uninstalling the npm azure cli then reinstalling it fixed the issue I described in this question.所以卸载 npm azure cli 然后重新安装它解决了我在这个问题中描述的问题。 The command still isn't consistent and sometimes just times out for seemingly no reason but this specific issue is solved.该命令仍然不一致,有时似乎无缘无故地超时,但这个特定问题已经解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM