我按照这里的指南进行操作:https://johnnyreilly.com/using-bun-in-azure-pipelines并且它有效。
- task: Npm@1
displayName: setup bun
inputs:
command: 'custom'
customCommand: 'install -g bun'
verbose: true
但是,如果我没记错的话,它会在每个版本上安装bun?
上下文:
/usr/local/bin/npm install -g bun
added 3 packages in 21s
npm verbose cli /usr/local/bin/node /usr/local/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verbose title npm install bun
npm verbose argv "install" "--global" "bun"
npm verbose logfile logs-max:10 dir:/home/vsts/.npm/_logs/2024-07-02T11_06_44_941Z-
npm verbose logfile /home/vsts/.npm/_logs/2024-07-02T11_06_44_941Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/bun 1126ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-linux-x64 1600ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-darwin-x64 1539ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-windows-x64 1608ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-linux-aarch64 1580ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-darwin-aarch64 1602ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-linux-x64-baseline 1567ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-darwin-x64-baseline 1586ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven%2fbun-windows-x64-baseline 1587ms (cache miss)
npm verbose reify failed optional dependency /usr/local/lib/node_modules/bun/node_modules/@oven/bun-windows-x64-baseline
npm verbose reify failed optional dependency /usr/local/lib/node_modules/bun/node_modules/@oven/bun-windows-x64
npm verbose reify failed optional dependency /usr/local/lib/node_modules/bun/node_modules/@oven/bun-linux-aarch64
npm verbose reify failed optional dependency /usr/local/lib/node_modules/bun/node_modules/@oven/bun-darwin-x64-baseline
npm verbose reify failed optional dependency /usr/local/lib/node_modules/bun/node_modules/@oven/bun-darwin-x64
npm verbose reify failed optional dependency /usr/local/lib/node_modules/bun/node_modules/@oven/bun-darwin-aarch64
npm http fetch GET 200 https://registry.npmjs.org/bun/-/bun-1.1.17.tgz 728ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.1.17.tgz 3743ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.1.17.tgz 3790ms (cache miss)
npm info run [email protected] postinstall node_modules/bun node install.js
npm info run [email protected] postinstall { code: 0, signal: null }
npm verbose exit 0
npm info ok
Finishing: setup bun
是否有办法缓存或使其仅安装一次?
但是,如果我没记错的话,它会在每个版本上安装bun?
是的
是否有办法缓存或使其仅安装一次?
管道缓存在这种情况下可能会有所帮助,因为它可以通过允许在以后的运行中重用一次运行的输出或下载的依赖项来帮助减少构建时间。