npm run pub后报错
来源:13-4 ts-axios 编译与发布 运行部署脚本

慕少8034756
2020-02-10
老师,在提交后,提示如下错误,到百度中也搜索了,查询不到相关问题的处理方法,请帮忙指导一下!
Enter release version:
1.0.1
Realeaing 1.0.1 - are you sure? (y/n)y
Realeaing 1.0.1 …
On branch master
nothing to commit, working tree clean
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ts-axios-rockyhu@1.0.0-dev pub: sh release.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ts-axios-rockyhu@1.0.0-dev pub script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rockyhu/.npm/_logs/2020-02-10T13_07_47_713Z-debug.log
2回答
-
慕少8034756
提问者
2020-02-10
#!/usr/bin/env sh
set -e
echo "Enter release version:"
read VERSION
read -p "Realeaing $VERSION - are you sure? (y/n)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Realeaing $VERSION ..."
# commit
git add -A
git commit -m "[build] $VERSION"
npm version $VERSION --message "[release] $VERSION"
git push origin master
# publish 发布到npm
# 发布前需要在终端登录npm,即执行npm login,按照引导输入即可
npm publish
fi00 -
ustbhuangyi
2020-02-10
贴一下你的 release.sh 代码
032020-02-10
相似问题