请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

npm run pub之后,在选择y之后,并没有进行发布

图片描述
release.sh 文件:

#!/usr/bin/env sh
set -e

echo "Enter release version: "
read VERSION
read -p "Release $VERSION -are you sure?(y/n)" -n 1 -r
echo #(optional) move to a new line
if [[ $RELY =~ ^[Y/y]$ ]]
then
    echo "Release $VERSION ..."
    
    #commit
    git add -A
    git commit -m "[build] $VERSION"
    npm version $VERSION --message "[release]  $VERSION"
    git push origin master

    #publish
    npm publish
fi

项目地址:
我的项目

正在回答 回答被采纳积分+3

1回答

ustbhuangyi 2020-11-15 10:42:16

控制台输出了哪些信息?

0 回复 有任何疑惑可以回复我~
  • 提问者 qq_洌_0 #1
    src/index.ts 鈫?dist/axios.umd.js, dist/axios.es5.js...
    created dist/axios.umd.js, dist/axios.es5.js in 1.6s
    
    > ts-axios-li@0.0.2 pub F:\typescrit瀛︿範\ts-axios
    > sh release.sh
    
    Enter release version:
    0.0.2
    Releasing 0.0.2 - are you sure? (y/n)y
    Releasing 0.0.2 ...
    warning: LF will be replaced by CRLF in package-lock.json.
    The file will have its original line endings in your working directory
    
    Warning: Setting pre-commit script in package.json > scripts will be deprecated
    Please move it to husky.hooks in package.json, a .huskyrc file, or a husky.config.js file
    Or run ./node_modules/.bin/husky-upgrade for automatic update
    
    See https://github.com/typicode/husky for usage
    
    husky > pre-commit (node v12.10.0)
    No staged files match any of provided globs.
    On branch master
    nothing to commit, working tree clean
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! ts-axios-li@0.0.2 pub: `sh release.sh`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the ts-axios-li@0.0.2 pub script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    回复 有任何疑惑可以回复我~ 2020-11-16 08:38:29
  • ustbhuangyi 回复 提问者 qq_洌_0 #2
    你把 npm version $VERSION --message "[release] $VERSION" 这句放在 git add -A 前面试试
    回复 有任何疑惑可以回复我~ 2020-11-16 10:19:24
  • 提问者 qq_洌_0 回复 ustbhuangyi #3
    我自己执行了npm publish --allow-same-version    
    就可以了...  第一次发布应该没有相同版本
    回复 有任何疑惑可以回复我~ 2020-11-16 11:13:01
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信