node.js - 语义发布无法发布到 npm

标签 node.js npm node-modules circleci semantic-release

我正在使用 semantic-release npm 模块在 circle ci 中进行发布。我收到以下错误

[semantic-release] [@semantic-release/npm] › ℹ Write version 1.0.0 to package.json in /home/circleci/tmp npm ERR! Version not changed, might want --allow-same-version

npm ERR! A complete log of this run can be found in: npm ERR!
/home/circleci/.npm/_logs/2019-01-19T15_21_36_194Z-debug.log [3:21:36 PM] [semantic-release] › ✖ Failed step "prepare" of plugin "@semantic-release/npm" [3:21:36 PM] [semantic-release] › ✖ An error occurred while running semantic-release: { Error: Command failed: npm version 1.0.0 --no-git-tag-version npm ERR! Version not changed, might want --allow-same-version

npm ERR! A complete log of this run can be found in: npm ERR!
/home/circleci/.npm/_logs/2019-01-19T15_21_36_194Z-debug.log

at makeError (/home/circleci/tmp/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/home/circleci/tmp/node_modules/execa/index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)   code: 1,   stdout: '',   stderr:    'npm ERR! Version not changed,

might want --allow-same-version\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!
/home/circleci/.npm/_logs/2019-01-19T15_21_36_194Z-debug.log\n',
failed: true, signal: null, cmd: 'npm version 1.0.0 --no-git-tag-version', timedOut: false, killed: false, pluginName: '@semantic-release/npm' } { Error: Command failed: npm version 1.0.0 --no-git-tag-version npm ERR! Version not changed, might want --allow-same-version

npm ERR! A complete log of this run can be found in: npm ERR!
/home/circleci/.npm/_logs/2019-01-19T15_21_36_194Z-debug.log

at makeError (/home/circleci/tmp/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/home/circleci/tmp/node_modules/execa/index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)   code: 1,   stdout: '',   stderr:    'npm ERR! Version not changed,

might want --allow-same-version\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!
/home/circleci/.npm/_logs/2019-01-19T15_21_36_194Z-debug.log\n',
failed: true, signal: null, cmd: 'npm version 1.0.0 --no-git-tag-version', timedOut: false, killed: false, pluginName: '@semantic-release/npm' }Exited with code 1

我该如何解决这个问题?

最佳答案

错误的发生可能是因为您手动更新了 package.json 中的版本。你应该让语义释放为你做这件事。

您应该将 package.json 中的版本设置为 0.0.0-dev。如果您想将更新后的 package.json 推送到您的存储库,请使用 @sematnic-release/git 插件。

关于node.js - 语义发布无法发布到 npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54268668/

相关文章:

node.js - 是否可以执行包选项而无需在 package.json 中显式声明它们?

适用于 Windows 的 node.js BLE API 需要外部加密狗

node.js - 应用程序更新问题 yml 文件不是在 Electron 中生成的吗?

node.js - npm 依赖解析 - 或者 - 帮助!我无法安装 derbyjs

git - 使用主机 SSH key 在 DockerFile 中访问私有(private) Git 存储库

node.js - docker-compose 看不到来自 npm 的 node_modules

javascript - node_modules 包如何读取项目根目录下的配置文件?

javascript - 如何正确导出和导入cypress插件index.ts的函数?

reactjs - import react-admin 中断 tsc build

npm - travis ci npm发布错误 "missing api_key"