忽略天蓝色管道中缺少纱线的未满足依赖关系警告 [英] Ignore yarn missing unmet dependencies warning in azure pipelines
问题描述
我正在努力使纱线在天蓝色的管道上工作.我在带有Node 8和Yarn 1.13的自托管Windows 10计算机上运行.
I'm struggling to get a build with yarn working on azure pipelines build. I'm running on a self hosted windows 10 machine, with Node 8 and Yarn 1.13.
我的管道定义可以归结为:
My pipeline definition can be boiled down to:
steps:
- powershell: |
yarn install --frozen-lockfile
我得到的输出是
##[section]Starting: PowerShell
==============================================================================
Task : PowerShell
Description : Run a PowerShell script on Windows, macOS, or Linux.
Version : 2.140.2
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
==============================================================================
Generating script.
##[command]"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work\_temp\24a48e14-3107-454e-bb0b-28c377addce3.ps1'"
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
##[error]yarn : warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
##[error]At C:\agent\_work\_temp\24a48e14-3107-454e-bb0b-28c377addce3.ps1:3 char:1
##[error]+ yarn install --frozen-lockfile
##[error]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[error] + CategoryInfo : NotSpecified: (warning " > boo...ery@1.9.1 - 3".:String) [], RemoteException
##[error] + FullyQualifiedErrorId : NativeCommandError
##[error]
##[error]PowerShell exited with code '1'.
##[section]Finishing: PowerShell
我期望收到许多未满足的对等相关性警告(bootstrap只是许多警告中的第一个)(由于它们是互斥的,因此基本上不可能通过安装正确的软件包来解决它们-例如,webpack stylelint尚未正确更新半年)
I'm expecting to get many unmet peer dependency warnings (bootstrap is just the first of many) (and it's basically impossible to resolve them by installing the correct packages since they are mutually exclusive - e.g. webpack stylelint hasnt been correctly updated for half a year)
我尝试将stderr重定向到文件,因为yarn将错误记录为警告(源)
I've tried redirecting stderr to a file, since yarn logs the error as a warning (source) and that uses stderr (source)
steps:
- powershell: |
yarn install --frozen-lockfile 2>err.txt
但是会产生相同的输出,并且err.txt为空.
but that produces the same output, and err.txt is empty.
我也尝试将输出捕获到一个变量中,但是它仍然会写入错误
I also tried capturing the output into a variable, but it still writes the error
steps:
- powershell: |
$foo = yarn install --frozen-lockfile 2>err.txt
产生:
##[section]Starting: PowerShell
==============================================================================
Task : PowerShell
Description : Run a PowerShell script on Windows, macOS, or Linux.
Version : 2.140.2
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
==============================================================================
Generating script.
##[command]"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work\_temp\743ab1e7-3b9a-4659-89b9-7320da0ea69a.ps1'"
##[error]yarn : warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
##[error]At C:\agent\_work\_temp\743ab1e7-3b9a-4659-89b9-7320da0ea69a.ps1:3 char:8
##[error]+ $foo = yarn install --frozen-lockfile 2>err.txt
##[error]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[error] + CategoryInfo : NotSpecified: (warning " > boo...ery@1.9.1 - 3".:String) [], RemoteException
##[error] + FullyQualifiedErrorId : NativeCommandError
##[error]
##[error]PowerShell exited with code '1'.
##[section]Finishing: PowerShell
根据要求,将stderr重定向到stdout也不起作用:
As requested, redirecting stderr to stdout doesnt work either:
steps:
- powershell: |
$foo = yarn install --frozen-lockfile 2>&1
或
steps:
- powershell: |
yarn install --frozen-lockfile 2>&1 | Out-Null
产生:
##[section]Starting: PowerShell
==============================================================================
Task : PowerShell
Description : Run a PowerShell script on Windows, macOS, or Linux.
Version : 2.140.2
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
==============================================================================
Generating script.
##[command]"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work\_temp\e34f54b3-f15e-426c-aa65-1476ed3d3d34.ps1'"
##[error]yarn : warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
##[error]At C:\agent\_work\_temp\e34f54b3-f15e-426c-aa65-1476ed3d3d34.ps1:3 char:8
+ $foo = yarn install --frozen-lockfile 2>&1
##[error]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[error] + CategoryInfo : NotSpecified: (warning " > boo...ery@1.9.1 - 3".:String) [], RemoteException
##[error] + FullyQualifiedErrorId : NativeCommandError
##[error]
##[error]PowerShell exited with code '1'.
##[section]Finishing: PowerShell
推荐答案
我遇到了同样的问题:
对我来说,解决方案是将其更改为
for me the solution was to change it from
steps:
- powershell: yarn install
到
steps:
- script: yarn install
这篇关于忽略天蓝色管道中缺少纱线的未满足依赖关系警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!