gpt4 book ai didi

node.js - 发布 NPM 包的开发版本

转载 作者:搜寻专家 更新时间:2023-10-31 22:26:03 24 4
gpt4 key购买 nike

如何发布开发版的 NPM 包?

我尝试为 package.json 中的 version 字段设置 "dev" 值,但发布时出现错误:

$ npm publish
npm ERR! Error: Invalid version: "dev"
npm ERR! at Object.module.exports.fixVersionField (/usr/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:180:13)
npm ERR! at /usr/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js:29:38
npm ERR! at Array.forEach (native)
npm ERR! at normalize (/usr/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js:28:15)
npm ERR! at final (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:310:33)
npm ERR! at then (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:124:33)
npm ERR! at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:299:40
npm ERR! at fs.js:266:14
npm ERR! at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:103:5
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "node" "/usr/bin/npm" "publish"
npm ERR! cwd /home/ionicabizau/package-name
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.23
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ionicabizau/package-name/npm-debug.log
npm ERR! not ok code 0

哪些是最接近的替代方案?

最佳答案

您可以 upload prerelease tags to npm .这些标签不会与正常的 semver 范围语义匹配,但允许您使用和上传开发版本。一个例子是 1.3.5-alpha.3。如果你上传的东西还没有版本,那么合理的使用应该是 0.0.1-alpha.1

关于node.js - 发布 NPM 包的开发版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21355508/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com