node.js - Azure linux上的Git推送 Node js失败,kudu想要运行dotnet命令

标签 node.js linux git azure kudu

从本地 git 推送到 Azure 应用服务 git 失败。

直到昨天为止,这一直运作良好。我真的不明白为什么当应用程序在Linux中运行时,dotnet会参与Azure中的推送执行。我在本地从 Windows Powershell 运行 git 并部署到 linux,git add 和 git commit 工作正常,但推送失败。我搜索过类似的问题,但这与我在这里找到的其他问题有点不同。

The error is from git push:
PS xxx_deploy> git push 
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 212 bytes | 212.00 KiB/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Could not execute because the specified command or file was not found.
remote: Possible reasons for this include:
remote:   * You misspelled a built-in dotnet command.
remote:   * You intended to execute a .NET Core program, but dotnet-/opt/Kudu/KuduConsole/kudu does not exist.
remote:   * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
To https://xxxx.scm.azurewebsites.net/xxxx.git

正在部署的文件是 .html.js.svg.txt.css.png.ico、一些 .woff 字体
我已经检查过,它正在寻找的 dotnet 不在该文件夹中,但为什么它需要它来进行 Node js 部署?

我通过谷歌搜索尝试了一些建议,包括:

  • 回车和换行标志,“git config --global core.autocrlf true”,我尝试了 true 和 false
  • 我删除了 Azure 应用程序的/home/site/deployments/tools/中的文件,因为有人建议部署文件可能已损坏,但这没有帮助。

我希望得到一些解决方案,因为我无法再向应用程序推送新的更改。

最佳答案

问题已解决

经过尝试了一些解决方案,问题终于得到解决。

我的假设是,问题源于 Azure 应用服务平台版本的更改。我可以确认这一点,因为我保存了前一周的应用程序设置副本。以前的版本是 PLATFORM_VERSION 94.0.7.109,新版本是 PLATFORM_VERSION 95.0.7.554,适用于我的应用程序,我不知道其他版本。这也导致了环境变量的一些变化。例如,PATH 缺少/opt/dotnet/2.2:/root/.dotnet/tools,CLR 版本发生了变化,NODE_VERSION 也发生了变化。

这似乎导致已部署的文件和新推送的文件之间不匹配。 Kudu-git 最有可能在其 list 中存储了平台的一些元数据,因此无法构建新的推送。

对于将来遇到此问题的任何人:

要解决冲突,请在 Kudu 部署 URL 中创建一个 newui,例如https://xxxx.scm.azurewebsites.net/newui 在此页面中,打开 bash 终端并使用 rm 删除主目录中的所有内容,或打开文件管理器并删除主目录中的所有文件/文件夹。 执行新的 git 提交并推送,您的应用程序将正确部署。看起来这会清除您之前的所有部署。对于部署 Repo 来说效果很好,如果是源代码 Repo 将是一场灾难。

关于node.js - Azure linux上的Git推送 Node js失败,kudu想要运行dotnet命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68783434/

相关文章:

git - Jenkins "tag"使用 git 构建

node.js - 使用 npm-nock 创建动态模拟请求

c++ - 是否可以在nodejs或golang中使用Visual C++ MFC函数插件?

c++ - 一个 sh 语法错误

linux - 使用 "logger"登录到单独的日志文件

linux - 无法在 64 位 Linux 上构建 32 位 Wine

git - 警告 : this script is deprecated, 请参阅 git-completion.zsh

java - Jgit遍历特定分支的提交内容

node.js setInterval 不起作用

javascript - Node Javascript 的这一行条件有什么问题?