首页 > 解决方案 > Microsoft Build Engine 升级后无法发布 Angular 应用程序

问题描述

上周某个时候,Microsoft DevOps 从以下位置升级了 Build Engine:

适用于 .NET Core 的 Microsoft (R) Build Engine 版本 16.2.32702+c4012a063

适用于 .NET Core 的 Microsoft (R) Build Engine 版本 16.3.0+0f4c62fea

似乎这已将 NODE 更新到版本 13,并导致 Npm 包(node-saas)安装停止工作......

> node-sass@4.9.3 install D:\a\1\s\Website\ClientApp\node_modules\@angular-devkit\build-angular\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-72_binding.node": 

HTTP error 404 Not Found

升级前:

 > node-sass@4.9.3 install D:\a\1\s\Website\ClientApp\node_modules\@angular-devkit\build-angular\node_modules\node-sass
 > node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-64_binding.node
Download complete

URL 似乎从以下位置更改: https ://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-64_binding.node

https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-72_binding.node

有人可以帮忙解决这个问题吗?也许我可以在 Azure DevOps 中指定引擎版本...

在此处输入图像描述

标签: azure-devopsnode-sass

解决方案


Use Node.js ecosystem通过在任务之前在管道中添加任务,我们能够在构建系统中解决此问题npm install

  • 检查您的开发机器中它工作的节点环境,记下。
  • 将新任务添加到您的管道并搜索“Node.js 工具安装程序”。
  • 指定要在此任务中使用的节点版本
  • 保存管道

管道 yaml 如下所示:

steps:
- task: UseNode@1
  displayName: 'Use Node 8.12.0'
  inputs:
    version: 8.12.0

我们也同时从使用切换npm installnpm ci,但我现在不相信它是相关的。更新:我们尝试仅使用npm ci,但这并没有解决问题。


推荐阅读