node.jsnpmnpm-publish

New version of package is published but does not show up on npm and is not installable yet by user


I have issue with publishing my new version to npm. I saw this question: I published one package on npm, but it's not showing in the search list when i am going to search which is where I got how to check as I did below, but mine is looking a bit extended. Here's the package I'm working on: @code-collabo/node-mongo-cli

npm issue

I have published v1.0.1 which contains fix for an error on Windows OS today 2nd October, 2021 (about 12 hours ago) or more as at the time of writing. In the command line it said it's published, but the new version doesn't show up on npm and I also didn't receive a mail that it is published. I also checked with "npm show @code-collabo/node-mongo-cli", which lists that I have 2 versions published. But people are still only able to download the previous buggy version. In the stackoverflow link I added earlier, they say in there it takes a little while for it to update. But it's taken really long. This didn't happen for the first package I published about 6 months ago. Very confused about this.

Screenshot

npm show @code-collabo/node-mongo-cli

Screenshot 2021-10-02 at 4 48 37 PM

Also noticed this

npm i -g @code-collabo/node-mongo-cli

A. When I install globally from npm on my computer, it shows I'm downloading v1.0.1 which is the desired outcome Screenshot 2021-10-02 at 8 06 51 PM

B. But when some other person tries to download it it's still the previous v1.0.0 that is downloaded

WhatsApp Image 2021-10-02 at 2 50 43 PM

I'm not sure what to do about this.


Solution

  • Whew! After battling with this for 12 hours, I discovered I uploaded it to github package registry and not npm package registry. Keeping this here as a reminder for myself and any other person who needs it.

    I have this in my package.json file:

    "publishConfig": {
        "registry": "https://npm.pkg.github.com",
        "access": "public"
      }
    

    And this in my .npmrc file:

    //npm.pkg.github.com/:TOKEN_HERE
    

    The above pushed to github when I used:

    npm publish
    

    This github issue comment was helpful and publishes to npm instead:

    npm publish --@code-collabo:registry=https://registry.npmjs.org/