Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip "Ping npm registry" task when using --no-publish #226

Merged
merged 2 commits into from
May 26, 2018

Conversation

oligot
Copy link
Contributor

@oligot oligot commented Jan 9, 2018

Skip the task 'Ping npm registry' when the option --no-publish is
present on the command line, as this task is only useful when publishing
a package.

I tried to run np --no-publish with a custom npm registry (Nexus) set in ~/.npmrc and this fails without this patch as it tries to ping the npm registry, which is unfortunately not supported on Nexus.

Skip the task 'Ping npm registry' when the option `--no-publish` is
present on the command line, as this task is only useful when publishing
a package.

I tried to run `np --no-publish` with a custom npm registry ([Nexus](https://help.sonatype.com/display/NXRM3/Node+Packaged+Modules+and+npm+Registries)) set in `~/.npmrc` and this fails without this patch as it tries to ping the npm registry, which is unfortunately [not supported on Nexus](https://issues.sonatype.org/browse/NEXUS-13434).
@@ -12,7 +12,7 @@ module.exports = (input, pkg, opts) => {
const tasks = [
{
title: 'Ping npm registry',
skip: () => pkg.private || isExternalRegistry,
skip: () => pkg.private || isExternalRegistry || !opts.publish,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be handled in the other npm prerequisite tasks too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now also done for

  • Verify user is authenticated
  • Check npm version

prerequisite tasks

* Verify user is authenticated
* Check npm version
@zikaari
Copy link
Contributor

zikaari commented Jan 10, 2018

Why not use npm config get registry and end it once and for all?

So many np issues mentioning Nexus or other custom registry.

@sindresorhus sindresorhus changed the title Skip 'Ping npm registry' task when --no-publish Skip "Ping npm registry" task when using --no-publish May 26, 2018
@sindresorhus sindresorhus merged commit e4b85e1 into sindresorhus:master May 26, 2018
sindresorhus added a commit that referenced this pull request May 26, 2018
@oligot oligot deleted the skip-ping-no-publish branch May 26, 2018 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants