我在构建https://travis-ci.org/neverendingqs/openssl-self-signed-certificate/builds/187723295时注意到我在标记 repo 时忘记增加补丁版本。passing
但是,即使 npm 发布由于版本已经存在而失败,构建报告也是如此。
这是日志的结尾:
Deploying application
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 48
npm ERR! publish Failed PUT 403
npm ERR! Linux 4.8.12-040812-generic
npm ERR! argv "/home/travis/.nvm/v0.10.48/bin/node" "/home/travis/.nvm/v0.10.48/bin/npm" "publish"
npm ERR! node v0.10.48
npm ERR! npm v2.15.1
npm ERR! code E403
npm ERR! "You cannot publish over the previously published version 1.1.5." : openssl-self-signed-certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/travis/build/neverendingqs/openssl-self-signed-certificate/npm-debug.log
No stash found.
Done. Your build exited with 0.
如果它很重要,我将test
脚本packages.json
设置为exit 0
,但这发生在发布阶段之前,所以这不应该是问题(?)。
为什么发布失败时 Travis CI 没有报告构建失败?
编辑:
我使用 Travis CI CLI 通过运行来设置 NPM 发布travis setup npm
,基于https://docs.travis-ci.com/user/deployment/npm/。
我的.travis.yml
样子是这样的:
language: node_js
deploy:
provider: npm
email: myemail
api_key:
secure: blahblahblah
on:
tags: true
repo: neverendingqs/openssl-self-signed-certificate