np icon indicating copy to clipboard operation
np copied to clipboard

`np` interactive prompt exits at version selection with no output/error

Open lokimckay opened this issue 4 years ago • 6 comments

Description

When running np without any other arguments, the process abruptly exits after it reaches the version selection stage (right after asking to continue even though there are no commits)

image

Running np with a version argument provided (e.g. np patch) works successfully with no issues

image

I have a hunch the issue is related to using Azure as a custom registry, because using the regular npm registry prompts for a version input as expected

Sorry, I cannot provide a reproduction repository because I am working with sensitive company registry and code, and don't have the access to set up a separate Azure registry

Steps to reproduce

  1. npm install --save-dev np
  2. Configure an Azure feed as the npm registry e.g.
// .npmrc
registry=https://pkgs.dev.azure.com/<organisation>/_packaging/<package name>/npm/registry/
always-auth=true
// package.json
...
"publishConfig": {
    "registry": "https://pkgs.dev.azure.com/<organisation>/_packaging/<package name>/npm/registry/"
},
  1. Authenticate with the Azure feed: see here

  2. Run npx np in terminal

Expected behavior

np interactively prompts for a version input as seen here:

image

Environment

np - 7.4.0 (note: downgrading to version 5.0.0, does not have this same issue - but has other issues related to 2fa) Node.js - 12.21.0 npm - 6.14.11 Git - 2.30.0.windows.1 OS - Windows 10 Pro image

lokimckay avatar Apr 01 '21 06:04 lokimckay

That's actually pretty interesting, because giving the version through the prompt and through the cli should not have a Azure dependency.

Will be a tough bug to take a look at since it only seems to happen on Azure though, setting up a private repo account outside of npm might be troublesome to say the least.

dopecodez avatar Apr 02 '21 19:04 dopecodez

Got the same issue - @lokimckay what did you end up doing ?

etiennejcharles avatar Feb 15 '22 18:02 etiennejcharles

Did find there seems to be an authentification error of sorts - by running npx np preview

Could not pinpoint root cause yet. image

etiennejcharles avatar Feb 15 '22 18:02 etiennejcharles

@etiennejcharles
switched to semantic release instead

lokimckay avatar Feb 26 '22 16:02 lokimckay

Thanks for starting this thread as I'm on azure as well. It seems np followed by any non-whitespace is what causes the interactive UI to show up. That seems like an acceptable hurdle to just alter the release script command in package.json

joelstransky avatar Jul 07 '22 18:07 joelstransky

Thanks for starting this thread as I'm on azure as well. It seems np followed by any non-whitespace is what causes the interactive UI to show up. That seems like an acceptable hurdle to just alter the release script command in package.json

Turns out np passes the non-whitespace characters to npm version later on in the bump step which causes a failure. Seems I'm switching to semantic release as well.

joelstransky avatar Jul 07 '22 19:07 joelstransky

Tracked in #420

fregante avatar Feb 03 '23 11:02 fregante