错误'EMFILE:太多打开的文件,在发布中打开'VSTS'

时间:2018-01-14 14:07:11

标签: angular azure azure-pipelines-release-pipeline azure-deployment

我正在尝试使用Azure的Continous Delivery将Angular 5示例Heros应用程序部署到Azure,但是在发布时失败并出现以下错误:

2018-01-14T13:22:41.8301597Z ##[section]Starting: Deploy Azure App Service
2018-01-14T13:22:41.8501466Z ==============================================================================
2018-01-14T13:22:41.8501809Z Task         : Azure App Service Deploy
2018-01-14T13:22:41.8502244Z Description  : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs
2018-01-14T13:22:41.8502677Z Version      : 3.3.32
2018-01-14T13:22:41.8502922Z Author       : Microsoft Corporation
2018-01-14T13:22:41.8503185Z Help         : [More Information](https://aka.ms/azurermwebdeployreadme)
2018-01-14T13:22:41.8504109Z ==============================================================================
2018-01-14T13:22:46.1519999Z Got connection details for Azure App Service:'herotest'
2018-01-14T13:23:27.5420784Z ##[error]Error: EMFILE: too many open files, open 'd:\a\r1\a\temp_web_package_029438318867875735\node_modules\webdriver-js-extender\built\spec\command_tests\normal_spec.d.ts'
2018-01-14T13:23:33.6581680Z Successfully updated deployment History at https://herotest.scm.azurewebsites.net/api/deployments/11515936207535
2018-01-14T13:23:35.9365916Z ##[section]Finishing: Deploy Azure App Service

我尝试部署的代码是https://github.com/dragsdale75/hero

我之前按照本教程部署了基本应用程序,但它更简单。 https://passos.com.au/build-and-deploy-an-angular-app-from-github-to-azure-website/

对Angular Heros App所做的更改包括添加kuduscript,修改脚本和添加2个依赖项。

Azure Continous Delivery

由于构建成功,我觉得这不是一个Angular问题。但是,英雄应用程序示例不在最新版本的CLI上。

我不知道哪些附加信息会有所帮助,这是VSTS版本中唯一的步骤。它由Azure CI工具组装。

Deploy Azure App Service options

1 个答案:

答案 0 :(得分:1)

我假设你在Azure中配置了Node.js Web应用程序框架和None任务运行器的Continuous Delivery,构建任务是:1。Npm install 2.存档文件3.复制文件4.发布Build Artifacts。

通过这些任务,它不会构建应用程序并将所有源代码文件上传到应用程序服务,这对您的方案不起作用。

要解决此问题,您可以添加npm任务(步骤2)来构建您的应用程序,只需将输出文件发布到Artifact(步骤3:更改文件夹路径)并上传到应用程序服务:

  1. Npm安装任务
  2. Npm task(命令:custom;包含package.json的工作文件夹:$(System.DefaultWorkingDirectory);命令和参数:run build
  3. 存档文件(存档的根文件夹:$(System.DefaultWorkingDirectory)/dist
  4. 复制文件
  5. 发布构建工件