1、判断npm镜像,需设置为npm官方镜像
npm config get registry //查看当前镜像
npm config set registry https://registry.npmjs.org/ //设置为官方镜像
2、登录(有npm的账号下)
npm login
3、发布
npm publish
npm config get registry //查看当前镜像
npm config set registry https://registry.npmjs.org/ //设置为官方镜像
npm login
npm publish