我使用以下 URl 安装了 7.x NoodeJs, https://github.com/nodesource/distributions
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
按照链接 https://blogs.msdn.microsoft.com/appserviceteam/2016/12/01/running-azure-functions-locally-with-the-cli/ 中的说明安装了 azure-functions-cli ,
npm i -g azure-functions-cli
现在,当我运行“func init”时,出现以下错误, $ 函数初始化 : 没有这样的文件或目录
然后我尝试按照以下方式运行它,但仍然收到错误,
$ node /usr/lib/node_modules/azure-functions-cli/lib/main.js init
events.js:161
throw er; // Unhandled 'error' event
^
Error: spawn mono /usr/lib/node_modules/azure-functions-cli/bin/func.exe ENOENT
at exports._errnoException (util.js:1023:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:418:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:533:3
我还尝试安装 Mono 并重新运行该命令,但这也没有帮助。我使用以下 URL 中的说明来安装 Mono, 安装单声道, http://www.mono-project.com/docs/getting-started/install/linux/
最佳答案
Azure Functions CLI 不适用于 Windows 以外的平台。但是,我不确定为什么您会收到如此糟糕的错误消息。
CLI 有一个实验性端口可以在 Mono 上运行,但您需要自己构建该项目。此外,它不支持 JavaScript 函数。代码位于 https://github.com/Azure/azure-functions-cli/tree/mono-support .
关于node.js - azure-functions-cli : func init spits error "No such file or directory",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42251890/