npm 命令

NPM官网open in new window

查询设置镜像

# 查询当前配置的镜像
npm config get registry

# 设置成淘宝镜像
npm config set registry http://registry.npm.taobao.org/

# 换成原来镜像(发布npm包需要切回原镜像)
npm config set registry https://registry.npmjs.org/

发布删除包

# 登录
npm login

# 在原版本上 + 1
npm version patch

# 发布包
npm publish

# 删除指定版本包
npm unpublish name@0.0.1

# 删除整个包
npm unpublish name --force