gpt4 book ai didi

npm - 在没有干净的 git 工作目录的情况下更新 package.json 中的版本(没有像 Gulp 这样的任务运行器)

转载 作者:行者123 更新时间:2023-12-03 15:59:26 24 4
gpt4 key购买 nike

运行时:npm version prepatch我收到错误:“Git 工作目录不干净。”然后是尚未提交的文件列表。

但是,我想进行此预发布以使用私有(private) npm 注册表在本地测试一些东西。这意味着我不必使用 Git 提交文件。

是否可以在没有干净的 git 工作目录的情况下更新 package.json 中的版本?

最佳答案

来自 https://docs.npmjs.com/cli/version 的 npm 版本文档:

If run in a git repo, it will also create a version commit and tag. This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm --no-git-tag-version version. It will fail if the working directory is not clean, unless the -f or --force flag is set.



我不能 100% 确定您是否只需要 --no-git-tag-version,或者您是否还需要 --force 标志。

关于npm - 在没有干净的 git 工作目录的情况下更新 package.json 中的版本(没有像 Gulp 这样的任务运行器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52075039/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com