lerna: [Support] npm dist-tag not available on Nexus, looking for workaround

Hi,

We have a private NPM registry at our company, using Nexus. They don’t support npm dist-tag yet (NEXUS-9862). Since Nexus is pretty common for private NPM registries I imagine other people are also getting blocked by this.

Of course, ideally Nexus introduces npm dist-tag soon and this issue would be resolved. But in the meantime, I would like to check if there is a workaround 😃.

When I run lerna publish I get the following error:

Error updating version as latest
Error: Command failed: npm dist-tag ls mypackagename
npm ERR! registry error parsing json
npm ERR! dist-tag ls Couldn't get dist-tag data for mypackagename

I’ve looked a bit at the usages of npm dist-tag in the source code, and because they’re in a try/catch block, the publishing still succeeds. However, my Jenkins build will be marked as ‘broken’ because there are errors.

I was wondering if the npm dist-tag is strictly needed to work with Lerna? It only marks the published packages as the latest, right? So, am I correct that we could work around this error by working with exact version numbers in all our package.json files (thus not depending on what is marked as the ‘latest’)?

And if the above is correct, would you be open to introducing an option for lerna to skip the use of dist-tag? (e.g. lerna publish --skip-npm-dist-tag)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Oh, nice this would be a handy option for updating READMEs!

Maybe --skip-temp-tag? Fits in with --skip-npm, --skip-git