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

Set latest tag to v1.x on npm #61

Closed
3846masa opened this issue Feb 19, 2019 · 1 comment
Closed

Set latest tag to v1.x on npm #61

3846masa opened this issue Feb 19, 2019 · 1 comment

Comments

@3846masa
Copy link

Currently, npm install piexifjs will install a beta version.
When you want to install stable version, you run npm install piexifjs@^1.
However, it causes confusion.

Please consider to use npm dist-tag.
npm dist-tag can assign a tag (e.g. dev, beta, latest) to the specific version.
For example, you run npm dist-tag add piexifjs@1.0.4 latest, everyone can install v1.0.4 via only npm install piexifjs.
And, you run npm dist-tag add piexifjs@2.0.0-beta.7 beta, everyone can install v2.0.0-beta.7 via npm install piexifjs@beta.
See also, https://docs.npmjs.com/cli/dist-tag

And also, when you publish new beta version, you can run npm publish --tag beta.
See https://docs.npmjs.com/cli/publish


Because English is not good enough, I write it in Japanese.
英語が不得意なため、日本語でも書かせていただきます。

現在、piexifjs は、バージョンを指定しない場合、β版がインストールされるようになっています。
しかし、実用的には標準で安定版がインストールされるのが良いかと思われます。

解決方法としては、 npm dist-tag で特定バージョンにタグをつける方法があります。
(詳しくは https://docs.npmjs.com/cli/dist-tag をご覧ください)

npm は、バージョン指定をしない場合、 latest タグに紐付いたものをインストールします。
そのため、npm dist-tag add piexifjs@1.0.4 latest としていただけると、npm install piexifjs で安定版が入るようになります。
もちろん、同様に beta タグを付けるようにすれば、 npm install piexifjs@beta でインストールできます。

また、次のβ版を公開するときに npm publish --tag beta とすれば、β版を更新できます。
こちらも https://docs.npmjs.com/cli/publish を参照してください。

ぜひ、ご一考いただければ幸いです。

@3846masa 3846masa changed the title Set v1.x to latest on npm Set latest tag to v1.x on npm Feb 19, 2019
@hMatoba
Copy link
Owner

hMatoba commented Feb 19, 2019

ありがとうございます。やりたかったことだったので早速適用しておきました。
ご存知のように2.0.0はbetaなので、1.0.4にlatestを付けました。

@hMatoba hMatoba closed this as completed Feb 19, 2019
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

2 participants