How to Fix a Publishing Mistake


Well, been studying for midterms all week and my brain is fried. Made a very dumb mistake and published my package with minor, when I meant to use patch. I reverted the commit, deleted the release tag from my Github account, and republished the package with the correct version. Everything looks good, except in the package area (online package browser) of atom, the package is still listed at the incorrect version number, until I click on the package to expand the details on it. Is there any way to fix this, or is it just going to be wrong until I surpass that version number? Thanks.


Well, figured I’d add a feature that would justify releasing a new minor version, just to try to “cover up” the wrong version number that was still listed on Atom’s package manager… but I had errors trying to push out the new version. How can I fix the published version to be rolled back to my actual current version, so I can push out the update that is the version number currently listed on the APM store?


And they were? I don’t know much about fixing incorrect releases, but I might be able to tell you what the issue is, if you provide the error and other relevant info (e.g., link to the repository you’re working on).

Josephs-MacBook-Pro-15:strip-newlines josephlyons$ apm publish minor
Preparing and tagging a new version ✗

npm ERR! Darwin 17.4.0
npm ERR! argv "/Applications/" "/Applications/" "version" "minor" "-m" "Prepare %s release"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code 128

npm ERR! Command failed: git tag v0.3.0 -am Prepare 0.3.0 release
npm ERR! fatal: tag 'v0.3.0' already exists
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/josephlyons/github/strip-newlines/npm-debug.log
Josephs-MacBook-Pro-15:strip-newlines josephlyons$ 

Here’s the debug file:

0 info it worked if it ends with ok
1 verbose cli [ '/Applications/',
1 verbose cli   '/Applications/',
1 verbose cli   'version',
1 verbose cli   'minor',
1 verbose cli   '-m',
1 verbose cli   'Prepare %s release' ]
2 info using npm@3.10.10
3 info using node@v6.9.5
4 info git [ 'status', '--porcelain' ]
5 info lifecycle strip-newlines@0.3.0~preversion: strip-newlines@0.3.0
6 silly lifecycle strip-newlines@0.3.0~preversion: no script for preversion, continuing
7 verbose version.write data { name: 'strip-newlines',
7 verbose version.write   main: './lib/strip-newlines',
7 verbose version.write   version: '0.3.0',
7 verbose version.write   description: 'Strips out unnecessary newlines (LF and CRLF) from files.',
7 verbose version.write   keywords: [ 'strip', 'remove', 'clean', 'newlines', 'new', 'lines' ],
7 verbose version.write   repository: '',
7 verbose version.write   license: 'MIT',
7 verbose version.write   engines: { atom: '>=1.0.0 <2.0.0' },
7 verbose version.write   dependencies: {},
7 verbose version.write   configSchema:
7 verbose version.write    { consecutiveNewlinesAllowed:
7 verbose version.write       { title: 'Consecutive Newlines Allowed',
7 verbose version.write         description: 'This setting dictates how many consecutive newlines are allowed before stripping occurs (minimum of 0)',
7 verbose version.write         type: 'integer',
7 verbose version.write         default: 2,
7 verbose version.write         minimum: 0 } } } to package.json
8 info lifecycle strip-newlines@0.3.0~version: strip-newlines@0.3.0
9 silly lifecycle strip-newlines@0.3.0~version: no script for version, continuing
10 info git [ 'add',
10 info git   '/Users/josephlyons/github/strip-newlines/package.json' ]
11 info git [ 'commit', '-m', 'Prepare 0.3.0 release' ]
12 info git [ 'tag', 'v0.3.0', '-am', 'Prepare 0.3.0 release' ]
13 verbose stack Error: Command failed: git tag v0.3.0 -am Prepare 0.3.0 release
13 verbose stack fatal: tag 'v0.3.0' already exists
13 verbose stack
13 verbose stack     at ChildProcess.exithandler (child_process.js:206:12)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:191:7)
13 verbose stack     at maybeClose (internal/child_process.js:877:16)
13 verbose stack     at Socket.<anonymous> (internal/child_process.js:334:11)
13 verbose stack     at emitOne (events.js:96:13)
13 verbose stack     at Socket.emit (events.js:188:7)
13 verbose stack     at Pipe._handle.close [as _onclose] (net.js:498:12)
14 verbose cwd /Users/josephlyons/github/strip-newlines
15 error Darwin 17.4.0
16 error argv "/Applications/" "/Applications/" "version" "minor" "-m" "Prepare %s release"
17 error node v6.9.5
18 error npm  v3.10.10
19 error code 128
20 error Command failed: git tag v0.3.0 -am Prepare 0.3.0 release
20 error fatal: tag 'v0.3.0' already exists
21 error If you need help, you may report this error at:
21 error     <>
22 verbose exit [ 1, true ]


Anyone have any hints as to how I can move forward? I guess I’ll probably have to delete the package and re-upload it. Even though my download count is extremely low, the idea of losing them sort of bums me out.

Would either @leedohm or @DamnedScholar have any thoughts? My apologies for tagging you guys, but you two seem to answer most of my questions here and are both very respectable members.


There’s instructions in the Flight Manual on unpublishing a specific version. If you’ve done that and you’re getting an error about a tag existing, you have to delete the tag from both the local and remote repositories.


I’m able to delete it locally, delete it remotely, and unpublish the package via your instructions, thank you very much! However, now when I try to roll out the correct version, I get this:

Josephs-MBP-15:strip-newlines josephlyons$ apm publish minor
Preparing and tagging a new version ✓
Pushing v0.3.0 tag ✓
Publishing strip-newlines@v0.3.0 ✗
Creating new version failed: Application error
Josephs-MBP-15:strip-newlines josephlyons$