NPM 6.6.0 Breaks Access to `ls-collaborators`


(Alex Lee) #1

What I Wanted to Do

Use the module np to publish my package to the npm registry. Specifically, np tries to access ls-collaborators.

What Happened Instead

An error is thrown.

Reproduction Steps

Publish gist explaining steps

Details

This error does not occur on v6.5.0 or less.

The commit in question is: https://github.com/npm/cli/commit/b100ea8d6dd982016862223ff2c3294068b078c3#diff-b3d4d93df05cefeb70b0ea67d8a5801d

See thread within np.

Specific comment found bug: https://github.com/sindresorhus/np/issues/339#issuecomment-457178885

Platform Info

$ npm --versions
{ npm: '6.7.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.32.0',
  node: '8.11.3',
  openssl: '1.0.2o',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.54',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

Release: npm@6.8.0
Release: npm@6.8.0-next.2
(Kat Marchán) #2

This is an unintended regression due to a major rewrite of many of npm’s commands. The issue in question is an error while porting https://github.com/npm/npm-registry-client/blob/latest/lib/access.js#L118-L124 – basically, https://github.com/npm/cli/commit/b100ea8d6dd982016862223ff2c3294068b078c3#diff-b3d4d93df05cefeb70b0ea67d8a5801dR157 needs to have false as a second argument.

Sorry for the trouble. We expected some surprise breakage and left 6.6.0 in prerelease for a very long time, but a lot of these things are hard to find until you have actual users testing them out, I guess.


(Alex Lee) #3

Thanks for taking a look! Always difficult to know exactly what will change with rewrites. Will be looking forward to 6.8.0. Will downgrade to 6.5.0 in the meantime.


(Kat Marchán) #4

@alexlee-dev I’ve published a fix to the npm canary. Can you verify that npx npmc@latest ls-collaborators works as expected for you? I will try and get this patch into 6.8.0, so it will be fully fixed soon.


(Kat Marchán) #5

Patched by https://github.com/npm/cli/pull/151


npm token gives E401 since 6.6.0