1. Npm init
2.package.json
{
"name": "olivia-test-npm-first",
"version": "1.0.1",
"description": "Thisis testing first package.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
3.Create index.js
4. 创建脚本
5.登录NPM
输入用户名,密码,邮箱
npm login
6. 发布包
npm publish