问题
Some time last week Microsoft DevOps upgraded the Build Engine from:
Microsoft (R) Build Engine version 16.2.32702+c4012a063 for .NET Core
TO
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
It seems that this has update NODE to version 13 and has caused an Npm package (node-saas) installation to stop working...
> 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
Before the upgrade:
> 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
It seems like the URL changes from: https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-64_binding.node
TO
https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-72_binding.node
Can someone please help fix this issue? Perhaps I can specify the engine version in Azure DevOps...
回答1:
We were able to resolve this issue in our build system by adding the Use Node.js ecosystem
task in our pipeline prior to the npm install
task.
- Check the node environment in your development machine where it works, make a note.
- Add a new task to your pipeline and search for the "Node.js tool installer".
- Specify the node version that you want to use in this task
- Save the pipeline
The pipeline yaml looks something like the following:
steps:
- task: UseNode@1
displayName: 'Use Node 8.12.0'
inputs:
version: 8.12.0
We also switched from using Update: We tried using only npm install
to npm ci
at the same time, but I don't believe it to be related at this moment.npm ci
and this did not solve the issue.
回答2:
You can try removing the node_modules folder and package-lock.json, and clear the cache, then run npm install
on your local machine.
#remove node_module folder
#remove package-lock.json
npm cache clean
npm install
This will update node-sass to its latest version. And then push the changes to your git repo and rerun your pipeline. Check here for more information.
win32-x64-72_binding.node is not available for node sass 4.9.3. so it should be able to fix this issue when node sass update to the latest v4.13.0, check here for more information.
Addition:
To execute above command in your pipeline. You can add tasks as below example to execute above command. and run npm install. You need to config the setting according to your project for these tasks
来源:https://stackoverflow.com/questions/58803516/unable-to-publish-angular-application-after-microsoft-build-engine-upgrade