简体   繁体   中英

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.

在此输入图像描述

But.. is there a way to set the version of Node.js and 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+. Is there a way to enforce it?

PS: On-premise VSO build agent is not an option.

There is now a Node Tool installer available. 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.

Finds or downloads and caches the specified version of Node.js and adds it to the PATH

Try adding a Node Tool installer step before your node/npm steps.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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