1. 新建github库
git init git add . git commit -m "commit" git remote add origin git@github.com:zhangjiahao93/back-calculation.git git push -u origin master
2.推送并关联github
##新建package.json
npm init ##关联GitHub,在package.json 中添加 { "repository": { "type": "git", "url": "git@github.com:zhangjiahao93/back-calculation.git" } } ## 更新包版本 npm version 1.0.0 ## 发布至npm 默认公开 ## 参考 https://docs.npmjs.com/cli/publish npm publish