npm账户
npm adduser
npm whoami
- 初始化项目:
npm init --scope=<username>
项目必要文件
README.md
pageage.json
: 代码地址, 描述
description": {
},
.....
"repository": {
"url": "example.com"
}
发布项目
npm publish --tag x.x.x
- 管理标签
包管理
npm outdated
npm update <name>
其他
问题解决
Cannot read property '0' of undefined
//
Remove package-lock.json, remove node_modules, remove cache npm cache rm --force then npm install to generate a newer package-lock.json. It worked too but you should avoid switching node version.