如何在Azure发布管道任务中安装NPM软件包?

时间:2019-07-11 21:26:04

标签: npm

我想在发布管道中运行赛普拉斯。因此,我运行此脚本来安装所需的一切:

protocol Command {}
protocol ToDoCommand : Command {
    func performToDoCommand()
}
protocol UserCommand : Command {}

struct AddToDoCommand  : ToDoCommand {
    func performToDoCommand() {
        print("Add ToDo")
    }
}

struct EditToDoCommand : ToDoCommand {
    func performToDoCommand() {
        print("Edit ToDo")
    }
}

struct AddUserCommand  : UserCommand {}
struct EditUserCommand : UserCommand {}

class ToDoManager {
    func performCommand(_ command:Command) {
        guard let todoCommand = command as? ToDoCommand else {
            return
        }

        todoCommand.performToDoCommand()
    }
}

enter image description here

这是任务的输出:

enter image description here

我真的无法弄清楚出了什么问题,为什么我不能安装多个NPM软件包?

1 个答案:

答案 0 :(得分:0)

我不确定这是正确的解决方法,但是我运行了create file任务:

{
  "name": "@asd/suite",
  "version": "0.1.1",
  "description": "Embrace React Suite",
  "main": "index.js",
  "repository": "https://dev.azure.com/asd/asd/_git/client",
  "author": "Embrace",
  "license": "MIT",
  "private": true,
  "devDependencies": {
    "cypress": "^3.3.1",
    "mocha": "^5.2.0",
    "mocha-junit-reporters": "^1.23.6",
    "mocha-multi-reporters": "^1.1.7",
    "mochawesome": "^4.0.1",
    "mochawesome-merge": "^2.0.1",
    "mochawesome-report-generator": "^4.0.0"
  }
}

这将创建一个具有所需依赖关系的package.json文件,然后运行npm install任务。这样至少可以安装所有东西,因此我可以运行赛普拉斯。