It worked yesterday.
It worked yesterday.

Reputation: 4617

semantic-release fails to publish to npm

I am using semantic-release npm module to do the releases in circle ci. I am getting following error

[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

How do i fix this?

Upvotes: 4

Views: 5254

Answers (1)

Pierre Vanduynslager
Pierre Vanduynslager

Reputation: 929

The error probably happen because you updated the version in package.json manually. You should let semantic-release doing that for you.

You should set the version in your package.json to 0.0.0-dev. If you want to have the updated package.json pushed to your repo use the @sematnic-release/git plugin.

Upvotes: 8

Related Questions