赛普拉斯CI vsts找不到二进制文件

时间:2019-10-07 18:46:42

标签: cypress azure-pipelines-release-pipeline

能否请您给我一些有关如何解决此问题的建议。

构建管道

npm install
package.json
"dependencies": {
    "cypress": "^3.4.1"
  }

发布

Powershell命令

npm ./node_modules/.bin/Cypress run

The cypress npm package is installed, but the Cypress binary is missing.

2019-10-07T18:04:59.5720120Z We expected the binary to be installed here:

有一些关于如何缓存〜/ .npm的示例,但到目前为止似乎没有任何效果。关于如何在您的vsts中包含cypress.io的示例是在构建阶段,而不是在发布后。

1 个答案:

答案 0 :(得分:0)

根据错误日志,它提供了有关此问题的解决方案。您应该先运行cypress install命令,然后该错误将得到解决。

enter image description here

作为测试,由于我没有cypress.json文件,因此我需要运行open命令来 自动生成获取json文件和项目示例。 然后,打开命令将按预期运行。 ![enter image description here

但是因为我以交互方式运行open命令并且我的工件中没有cypress.json文件,所以这些任务最终失败了。

因此,如果您的存储库或工件中包含cypress.json,则只需添加

.\cypress install

在powershell命令中。

如果没有,则可以将相关的json文件和文件夹添加到存储库或工件中,然后run命令将按预期工作。