先托管到GitHub
echo node_modules > .gitnore //忽略 node_modules
git init //初始化空仓库
git status //查看git状态
git add . //添加当前目录下的文件
git commit -m "feat: initial commit" //代码提交
去 github 去创建仓库
git remote add origin https://github.com/****** //添加远端仓库别名
git push -u origin master //本地代码推送到云端
npm publish //推送到npm
注 淘宝镜像会出问题 用这个命令 // yarn publish --registry=https://registry.yarnpkg.com