Azure Web应用程序显示“没有此类文件或目录错误”

时间:2019-10-26 16:16:25

标签: node.js azure azure-cli kudu

我正在尝试将Node.js应用程序添加到天蓝色。我已经使用命令az login登录。我运行了命令

az webbapp up --name azuredemoapp

这是我得到的错误:-

The command failed with an unexpected error. Here is the traceback:

[Errno 2] No such file or directory: ''
Traceback (most recent call last):
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\knack\knack\cli.py", line 206, in invoke
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 603, in execute
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 661, in _run_jobs_serially
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 652, in _run_job
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli\azure\cli\command_modules\appservice\commands.py", line 55, in _polish_bad_errors
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 631, in _run_job
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 306, in __call__
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\__init__.py", line 485, in default_command_handler
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli\azure\cli\command_modules\appservice\custom.py", line 2783, in webapp_up
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli\azure\cli\command_modules\appservice\_create_util.py", line 59, in get_runtime_version_details
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli\azure\cli\command_modules\appservice\_create_util.py", line 192, in parse_netcore_version
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\xml\etree\ElementTree.py", line 1196, in parse
tree.parse(source, parser)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\xml\etree\ElementTree.py", line 586, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: ''

  To open an issue, please run: 'az feedback'

这是我的package.json文件

{
  "name": "azuredemodeploy",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "author": "Rohan Shenoy",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  }
}

1 个答案:

答案 0 :(得分:0)

问题很可能是您部署应用程序的方式或项目中文件的结构。

请确保您在项目根目录中有server.js或app.js。您还可以在packages.json中指定自定义启动脚本。有关更多信息,请参见此处:

https://docs.microsoft.com/en-us/azure/app-service/deploy-local-git#prepare-your-repository