在企业 Nexus 中发布库

publish a library in a corporate Nexus

我想在企业 Nexus 中发布一个库 使用 npm publish,但出现此错误:

npm notice
npm notice package: hostels-booking@1.0.0
npm notice === Tarball Contents ===
npm notice 52B  index.js
npm notice 226B package.json
npm notice === Tarball Details ===
npm notice name:          hostels-booking
npm notice version:       1.0.0
npm notice package size:  327 B
npm notice unpacked size: 278 B
npm notice shasum:        3aa58cc4a38555dc70eaf2b641ad7896fee72514
npm notice integrity:     sha512-bZYlLza6iwGFQ[...]LnNwhYDCoh5nQ==
npm notice total files:   2
npm notice
npm ERR! code E400
npm ERR! 400 Bad Request - PUT http://nexus.clouding.io:8088/nexus/content/repositories/npm-all/hostels-booking

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sandro\npm-cache\_logs19-11-22T10_19_05_950Z-debug.log

Hi,
npm ERR! 400 Bad Request - PUT http://nnexus.clouding.io:8088/nexus/content/repositories/npm-all/hostels-booking

我怀疑您正在尝试发布到不受支持的组存储库。您应该发布到托管存储库,因此假设您的托管注册表称为 npm-internal 您的命令应该是 npm publish --registry http://nexus.clouding.io:8088/nexus/content/repositories/npm-internal/ 或将其放入您的 .npmrc 配置文件中。如果您遵循文档 (for NXRM3 or for NXRM2),一切都应该没问题。