简体   繁体   English

如何在托管的VSO Build Agent中设置Node.js和NPM版本号?

[英]How to set Node.js and NPM version numbers in a hosted VSO Build Agent?

In Visual Studio Online you can now set build dependencies on the General tab of a build definition. 在Visual Studio Online中,您现在可以在构建定义的“常规”选项卡上设置构建依赖项。

在此输入图像描述

But.. is there a way to set the version of Node.js and NPM? 但..有没有办法设置Node.js和NPM的版本?

It seems like a hosted build agent is currently using Node.js v0.12.7 and NPM v2.11.3 but I need Node.js v4.2+ and NPM v3.3+. 看起来托管构建代理当前正在使用Node.js v0.12.7和NPM v2.11.3,但我需要Node.js v4.2 +和NPM v3.3 +。 Is there a way to enforce it? 有没有办法强制执行呢?

PS: On-premise VSO build agent is not an option. PS:内部部署VSO构建代理不是一种选择。

There is now a Node Tool installer available. 现在有一个Node Tool安装程序可用。 The link to software inventory shared by Daniel was very helpful, and I discovered the installer digging into the Node specs for Hosted VS2017 agent. Daniel共享的软件库存链接非常有用,我发现安装程序正在深入了解Hosted VS2017代理的Node规范。

Finds or downloads and caches the specified version of Node.js and adds it to the PATH 查找或下载并缓存指定版本的Node.js并将其添加到PATH

Try adding a Node Tool installer step before your node/npm steps. 尝试在节点/ npm步骤之前添加节点工具安装程序步骤。

It seems like there's a lot of misunderstanding as to what "demands" are. 似乎对“要求”是什么有很多误解。 A build with a specific demand does not change what software is available on the build agent . 具有特定需求的构建不会更改构建代理程序上可用的软件 A "demand" is simply a method of a build task expressing what requirements it has, so it can run on an agent that has the desired demands satisfied (these are the build agent's "capabilities"). “需求”只是构建任务的方法,表达它具有的需求,因此它可以在满足所需需求的代理上运行(这些是构建代理的“功能”)。

This list of software is what's on the hosted build agent. 此软件列表是托管构建代理上的内容。 If it's not there, and you can't install it via npm or the like, then you're out of luck. 如果它不存在,并且你无法通过npm等安装它,那么你就不走运了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM