Safe NPM package publish for Nexus
npm install npm-publish-nexusSafe NPM package publish for Nexus.
The Disallow override option does not work properly on Nexus (at least for the scoped packages).
That's why to integrate the publishing into CI requires a validation of the package version existence before publishing.
This package does it.
``bash`
npm i -D npm-publish-nexus
Setup variables
`bash`
export NPM_NEXUS_PUBLISHER_EMAIL=
export NPM_NEXUS_PUBLISHER_AUTH=
Then add to your package.json scripts a script with
`bash`
npm-publish-nexus --domain=https://example.com --repo=npm-local
where domain is the domain where the Nexus is hosted and repo is the name of the local repository.
Finally, run the script and you will see an output similar to
`bash``
The following versions are found for package @bla/bla:
- @bla/bla@1.0.3
- @bla/bla@1.0.0
- @bla/bla@1.0.4
- @bla/bla@1.0.5
The current version is already deployed, skipping publishing...
MIT