NPM安装在托管构建中失败

时间:2015-08-10 10:01:12

标签: npm tfsbuild azure-devops

我不熟悉在VSO上使用npm构建。我收到了关注错误,无法破译它。

我在Visual Studio Online Hosted构建控制器上使用新的脚本化构建。

有人可以帮忙吗?

2015-08-10T08:10:19.0790396Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\NpmInstall\0.1.3\NpmInstall.ps1
2015-08-10T08:10:19.2665455Z C:\Program Files\nodejs\npm.cmd  install
2015-08-10T08:11:25.8264607Z ##[error]npm ERR! Windows_NT 6.3.9600
2015-08-10T08:11:25.8264607Z ##[error]npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
2015-08-10T08:11:25.8264607Z ##[error]npm ERR! node v0.12.7
2015-08-10T08:11:25.8264607Z ##[error]npm ERR! npm  v2.11.3
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! code ECONNRESET
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! errno ECONNRESET
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! syscall read
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network read ECONNRESET
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network This is most likely not a problem with npm itself
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network and is related to network connectivity.
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network In most cases you are behind a proxy or have bad network settings.
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network 
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network If you are behind a proxy, please make sure that the
2015-08-10T08:11:25.8420849Z ##[error]npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
2015-08-10T08:11:26.1077158Z ##[error]npm ERR! Windows_NT 6.3.9600
2015-08-10T08:11:26.1077158Z ##[error]npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"

1 个答案:

答案 0 :(得分:1)

如果您正在使用VSO构建vNext,那么在VSO上使用NPM有一种非常简单的方法。

您可以按照以下步骤操作:

  1. 在Visual Studio Online的团队项目中,转到Build explorer页面并添加构建定义。
  2. 添加新的 npm install 构建步骤。默认情况下,工作目录默认值是项目的根目录。并在Arguments字段中指定npm install参数。
  3. enter image description here