npm install -g sinopia 安装
sinopia -l 127.0.0.1:4873 打开本地地址
出现问题
callback must be a funciton received undefined
解决:
local-fs.js文件第42行修改
fs.unlink(tmp,function(){})
cd 到某个指定仓库
mkdir unit-restful-axios(包的名称)
cd unit-restful-axios
npm init
生成package.json
PS:main 为index.js
vi index.js (创建index.js)
在index.js 中复制 封装起来的方法或内容
npm adduser --registry http://127.0.0.1:4873
npm publish --registry http://127.0.0.1:4873
npm config set registry http://127.0.0.1:4873
npm adduser --registry http://127.0.0.1:4873
npm publish --registry http://127.0.0.1:4873
sinopia -l 127.0.0.1:4873
npm config set registry http://127.0.0.1:4873
npm 官方发布
npm config set registry https://registry.npmjs.org/
npm publish
npm login
npm adduser --registry http://127.0.0.1:4873
npm publish --registry http://127.0.0.1:4873
sinopia -l 127.0.0.1:4873
npm config set registry http://127.0.0.1:4873