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

如何更新自己写的npm包(模块)? #3

Open
shaobeichen opened this issue May 3, 2018 · 0 comments
Open

如何更新自己写的npm包(模块)? #3

shaobeichen opened this issue May 3, 2018 · 0 comments

Comments

@shaobeichen
Copy link
Owner

shaobeichen commented May 3, 2018

68747470733a2f2f7777772e6e706d6a732e636f6d2e636e2f696d616765732f6e706d2e737667

前提:你已经写了一个npm包,然后已经上传到npm中,那么它的版本就是1.0.0;

更新版本

使用命令:npm version <update_type>进行修改,update_type 有三个参数,
第一个是patch, 第二个是minor,第三个是 major,
patch:这个是补丁的意思,补丁最合适;
minor:这个是小修小改;
major:这个是大改咯;

具体咋用:
比如我想来个1.0.1版本,注意,是最后一位修改了增1,那么命令:npm version patch 回车就可以了;
比如我想来个1.1.0版本,注意,是第二位修改了增1,那么命令: npm version minor 回车就可以了;
比如我想来个2.0.0版本,注意,是第一位修改了增1,那么命令: npm version major 回车就可以了;

发布新版本

cd 文件夹
npm publish

@shaobeichen shaobeichen changed the title 如何更新自己写的npm包(模块),假设已经在npm中发布了一个1.0.0版本的包; 如何更新自己写的npm包(模块)? May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant