- 需要 npm 帐号, 如果没有先去官网申请一个, 然后在本地
npm adduser
的时候输入已经注册的用户名和密码即可通过验证. - 在要上传的模块路径下, 检查 package.json 文件, 尽量完善一下其中的信息. 以便更多的人看到.
- 使用
npm publish
即可完成发布. 注意命名不要冲突了.
dependencies
are installed on both:
npm install from a directory that contains package.json
npm install $package on any other directory
devDependencies
are:
npm install on a directory that contains package.json, unless you pass the --production
flag
not installed on npm install $package on any other directory, unless you give it the --dev
option.