如何在托管的VSO Build Agent中设置Node.js和NPM版本号? [英] How to set Node.js and NPM version numbers in a hosted VSO Build Agent?

查看:114
本文介绍了如何在托管的VSO Build Agent中设置Node.js和NPM版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,在Visual Studio Online中,您可以在构建定义的常规"选项卡上设置构建依赖项.

In Visual Studio Online you can now set build dependencies on the General tab of a build definition.

但是..有没有办法设置Node.js和NPM的版本?

But.. is there a way to set the version of Node.js and NPM?

似乎托管构建代理当前正在使用Node.js v0.12.7和NPM v2.11.3,但是我需要Node.js v4.2 +和NPM v3.3 +.有办法执行吗?

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 .:本地VSO构建代理不是一种选择.

P.S.: 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.

查找或下载并缓存指定版本的Node.js,并将其添加到PATH

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

尝试在节点/npm步骤之前添加节点工具安装程序步骤.

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

这篇关于如何在托管的VSO Build Agent中设置Node.js和NPM版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆