简体   繁体   English

使用 xml2json package 在 Azure 应用服务中部署 NodeJS 时出错

[英]Error for deploy NodeJS in Azure App services with xml2json package

I tried to deploy NodeJS project with xml2json package in Azure Web App Service, but I got error because of python version, how can I solve this problem? I tried to deploy NodeJS project with xml2json package in Azure Web App Service, but I got error because of python version, how can I solve this problem?

在此处输入图像描述

I have tried to reproduce the issue by using the Visual Studio Code to deploy a sample node.js application with the XML2JSON Parser package by using this npm install xml2json --save command in the VS code terminal and installed this package successfully as shown below in the screenshot: I have tried to reproduce the issue by using the Visual Studio Code to deploy a sample node.js application with the XML2JSON Parser package by using this npm install xml2json --save command in the VS code terminal and installed this package successfully as shown below in the screenshot :

在此处输入图像描述

Then tried to publish the app to the Azure App Service by signing into your azure account and Right click--> Create new Web App( Advanced) --> Create a new resource group -->Node.js version--> OS(Windows/Linux) -->location-->App service plan.然后尝试通过登录到您的 azure 帐户并右键单击来将应用程序发布到 Azure 应用程序服务 ->创建新的 Web 应用程序(高级版本) -->创建一个OS( --> 应用程序(高级版)--> Windows/Linux) -->位置-->应用服务计划。

Then by expanding the app services in VS code and select your app service add new setting as shown below:然后通过在 VS 代码和 select 中扩展应用服务,您的应用服务添加新设置,如下所示:

在此处输入图像描述

Type this SCM_DO_BUILD_DURING_DEPLOYMENT and set its value to true .键入此SCM_DO_BUILD_DURING_DEPLOYMENT并将其值设置为true 在此处输入图像描述在此处输入图像描述

And select your app service and deploy to web app option-->your app-->done. select 您的应用服务并部署到 web 应用选项-->您的应用-->完成。在此处输入图像描述

Your application will be published successfully to the Azure App Service as shown below:您的应用程序将成功发布到 Azure 应用服务,如下所示:

在此处输入图像描述

Note : Make sure to use the latest node.js version and In the terminal, ensure you're in your app directory, then start Visual Studio Code with this- code.注意:确保使用最新的 node.js 版本并在终端中,确保您位于应用目录中,然后使用此code. cmd. cmd。

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

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