注意点
-
publish默认发布私有包,package的private属性无效,必须使用:
npm publish --access=public
-
组织包需要先创建团队(团队被删掉,包就没了!)
2种方式,效果看起来都是一样的
效果
非组织包:以npm账户名为前缀,
{
"name": "@ifgm/form",
"private":false,
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
组织包 ,新建了一个测试组织:json-components
{
"name": "@json-components/form",
"private":false,
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
直接推是推不上去的,需要
1、先设置团队
2、将自己添加进团队
取消发布
npm unpublish 包名|包名+版本 --force(可选)