Packages / do npm tags work ? #27112
-
Hello, I am using a Github Action to publish to Github Packages (npm): main.yml:
If I use the command “npm publish” in my workflow, it creates a package using the current version defined in my packages.json. This works fine. What I do not understand is that if I use the command “npm publish --tag next” in order to specify an npm tag to my package, the package is generated, but I find no trace of the tag. There is a difference though: the package isn’t listed as being the latest (cf. 1.0.5 / 1.0.6): What I would like to do is manage npm tags in order to be able to target latest/next dependencies like what is done here for example: https://www.npmjs.com/package/@angular/core?activeTab=versions Does Github Packages support this? For now, if I run the command “npm install github:peterhewat/test-packages@next” I get the error “…is not a valid repository name”. I have to remove the tag at the end as follows: “npm install github:peterhewat/test-packages”. This will install the last package created even if it is not specified as “latest version” (ie. 1.0.6 instead of 1.0.5 which is the “latest version”). |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
I tried to publish a new version 1.0.1 with next tag to my package, the same as yours, the latest version is still the previous one. I managed to install package with tag next in the following example:
There is the result: Please check whether this could work for you. |
Beta Was this translation helpful? Give feedback.
-
Hi @yanjingzhu Thanks for your message. Unfortunetly, it doesn’t work. If you publish another package with a different tag (ex: “beta”), it won’t be taken into account. The dependency @next will just get the latest package ignoring the “next” and “beta” tags. I got the following reply from GitHub Support:
My initial tests with dist-tag haven’t worked either. I’ll keep on looking into this. |
Beta Was this translation helpful? Give feedback.
-
Hello again @yanjingzhu –tag does seem to work for my use case after all. Cheers, Peter |
Beta Was this translation helpful? Give feedback.
-
I am so glad to hear that you have resolved your issue. In my example, I also used npm publish --tag next as you said . |
Beta Was this translation helpful? Give feedback.
-
One of the last pages of packages handels about combination of automatisation and modification, actions |
Beta Was this translation helpful? Give feedback.
-
That I must evaluate first, but yes it’s the only exception with packages. The last example I guess |
Beta Was this translation helpful? Give feedback.
-
Good job! I was sure it worked in theory, but when I read about it I was sure that someone was bullying me again. It’s fun if it’s friendly, strange doug that yesterday everyone believed that woman. Then I panicked. |
Beta Was this translation helpful? Give feedback.
-
Are you now the issuer? Or am I wrong? |
Beta Was this translation helpful? Give feedback.
-
What a pithy. It should be good training stuff. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
I am so glad to hear that you have resolved your issue. In my example, I also used npm publish --tag next as you said .