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?
P.S.: On-premise VSO build agent is not an option.
To prevent this, use --save-exact flag in addition to --save or --save-dev . This flag will force NPM to store the exact module version in the package.
User CommandsUse the command n followed by the version number needed by the application. It is that simple. It's also possible to use the command n latest to use the current version of Node or n lts for the latest LTS version.
Use the engines keyword in the package. json file to specify the Node. js version that you want your application to use. You can also specify a version range using npm notation.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With