Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve registry conflict #3

Closed
mithi opened this issue Aug 11, 2020 · 0 comments
Closed

Resolve registry conflict #3

mithi opened this issue Aug 11, 2020 · 0 comments

Comments

@mithi
Copy link
Owner

mithi commented Aug 11, 2020

SOLUTION

$ npm login --registry=https://npm.pkg.github.com --scope=@mithi
$ npm publish --dry-run

from NPM docs

https://docs.npmjs.com/misc/scope

You can associate a scope with a registry at login, e.g.

npm config set @myco:registry http://reg.example.com

Once a scope is associated with a registry, any npm install for a package with that scope will request packages from that registry instead. Any npm publish for a package name that contains the scope will be published to that registry instead.

Problem

v0.1.12 on GitHub registry
https://github.com/mithi/bare-minimum-2d/packages/352301

v0.1.11 on NPM registry
https://www.npmjs.com/package/bare-minimum-2d

But there is actually no difference between the two versions

Notes

npm publish will publish to the github registry because of .npmrc file below
https://github.com/mithi/bare-minimum-2d/blob/master/.npmrc
which has

registry=https://npm.pkg.github.com/mithi

BUT BEFORE PUBLISHING, you need to edit package.json
https://github.com/mithi/bare-minimum-2d/blob/master/package.json
to be

{
  "name": "@mithi/bare-minimum-2d",
  "version": "0.1.12",
}

and to publish to the npm registry, you'd have to remove .npmrc file
and change the name back to { "name": "bare-minimum-2d" }

This is of course a hack which should be resolved.

Please refer to the following in the docs:
https://docs.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages#publishing-packages-to-npm-and-github-packages

Note: If you need to publish to registries that have different scope prefixes, you'll need to modify the package.json file on the runner to change the scope prefix. For example, if you publish a package to the @mona scope for npm and @octocat scope for GitHub Packages, you can replace the @mona scope with @octocat in the package.json file on the runner after publishing to npm and before publishing to GitHub Packages.

@mithi mithi changed the title TODO: Resolve version conflict (0.1.11 in npm registry and 0.1.12 in github registry) Resolve registry conflict Aug 11, 2020
@mithi mithi pinned this issue Aug 11, 2020
@mithi mithi closed this as completed Aug 11, 2020
@mithi mithi unpinned this issue Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant