你好。我决定在这里为 node.js 创建并发布一个包。我读了几篇关于包设计的文章,给出了命令“npm init”然后我们就开始了。编写代码,编写 README.md,将所有内容保存到 gitlab,执行“npm publish”并且......没有留下深刻印象。
怎么可能大家把README.md的内容作为文档“附加”到包页面(例如:https://www.npmjs.com/package/express-session),但是我得到了这样的东西:https://www.npmjs.com/package/express-sticky-cluster
package.json 内容:
{
"author": {
"name": "Valeriy V. Pushkar",
"email": ""
},
"bugs": {
"url": "https ://github.com/kainpl/express-sticky-cluster/issues"
},
"dependencies": {
"http-proxy": "*",
"merge": "*",
"cookie": "*"
},
"description": "Sticky session balancer based on a cluster and node-http-proxy modules, with express and socket.io support",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "671d155887bf4b6b3055989ef65b077c022df890",
"tarball": "https ://registry.npmjs.org/express-sticky-cluster/-/express-sticky-cluster-0.0.1.tgz"
},
"gitHead": "066bc4d03d2d058ff534be1949120a41d0507464",
"homepage": "https ://github.com/kainpl/express-sticky-cluster#readme",
"keywords": [
"express.js",
"cluster",
"http-proxy",
"socket.io",
"sticky-cluster",
"sticky-sessions"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "kain_pl",
"email": ""
}
],
"name": "express-sticky-cluster",
"optionalDependencies": {},
"readme": "https ://github.com/kainpl/express-sticky-cluster#readme",
"repository": {
"type": "git",
"url": "git+https ://github.com/kainpl/express-sticky-cluster.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.1"
}
谢谢!问题的答案:
删除自述文件字段。然后 npm 会自己做所有事情 - Alexey Ten