查看npm登录账号
npm whoami
首次注册的记得验证下邮箱
不然会报错: ERR! E403 you must verify your email before publishing a new package: www.npmjs.com/email-edit error Command failed with exit code 1.
登录npm的账号的邮箱 去验证下
登录账号
npm adduser
发布之前设置镜像源
不要用淘宝镜像发布,注意是 (https)
npm config set registry https://registry.npmjs.org/
npm publish发布
有时候镜像源不成功可以指定源发布
npm publish --registry=registry.npmjs.org
有时侯由于网络问题经常不成功多试几次