【问题标题】:SerenityJS - Problem Getting Started with NPM CI Command - Serenity-BDD CLI jarSerenityJS - NPM CI 命令入门问题 - Serenity-BDD CLI jar
【发布时间】:2021-02-20 20:53:02
【问题描述】:
我在我的 Mac 上工作,我正在尝试使用此处找到的 Serenity JS 模板项目:https://github.com/serenity-js/serenity-js-cucumber-protractor-template。在我安装了所有先决条件并克隆了代码后,我运行了“npm ci”命令,但失败并出现错误:
Looks like you need the latest Serenity BDD CLI jar. Let me download it for you...
I'm terribly sorry, but something didn't go according to plan.
The API call has failed
我在我的个人电脑上执行了相同的过程,但没有遇到此问题。那么,也许它与我的工作机器上的安全性有关?我有管理员权限,但不能运行任何 sudo 命令。任何建议将不胜感激。
【问题讨论】:
标签:
serenity-bdd
serenity-js
【解决方案1】:
当@serenity-js/serenity-bdd 模块无法下载 Serenity BDD 报告 CLI - 一个通过 https://jcenter.bintray.com/ 分发的 Java 工件 (.jar) 时,会出现此错误。
当npm install 或npm ci 命令在package.json 中调用此postinstall script 时,将调用下载过程本身:
"postinstall": "serenity-bdd update"
在工作环境中出现此错误可能有多种原因:
- 您的计算机可能被限制调用外部工件存储库,例如
jcenter.bintray.com。如果是这种情况,那么您很可能有一个内部工件存储库(如 Artifactory 或 Nexus),它反映了外部存储库。如果你有它,那么你可以告诉serenity-bdd 从那里获取.jar:
"postinstall": "serenity-bdd update --repository https://mycompany.com/artfactory"
- 另一个常见问题是公司代理乱用 SSL 证书,您可以通过指示
serenity-bdd 忽略任何无效证书来避免这种情况:
"postinstall": "serenity-bdd update --ignoreSSL"
希望这会有所帮助!
一月