Sandro Rey
Sandro Rey

Reputation: 2989

publish a library in a corporate Nexus

I want to publish a library in a corporate Nexus using npm publish, but I am getting this error:

npm notice
npm notice package: [email protected]
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\_logs\2019-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

Upvotes: 1

Views: 1126

Answers (1)

Dawid Sawa
Dawid Sawa

Reputation: 2194

I suspect you are trying to publish to a group repository, which isn't supported. You should publish to the hosted repository, so assuming your hosted registry is called npm-internal your command should be npm publish --registry http://nexus.clouding.io:8088/nexus/content/repositories/npm-internal/ or put it in your .npmrc config file. If you follow documentation (for NXRM3 or for NXRM2) everything should be fine.

Upvotes: 2

Related Questions