np: Command failed: npm access ls-collaborators X

❯ np --version
4.0.1

❯ np patch --yolo
  ❯ Prerequisite check
    ✔ Ping npm registry
    ✖ Verify user is authenticated
      → npm ERR! npm access edit [<package>]
      Check git remote
      Validate version
      Check for pre-release version
      Check git tag existence
    Git
    Bumping version using npm
    Publishing package using npm
    Pushing tags

✖ Command failed: npm access ls-collaborators supports-webp
npm ERR! 
npm ERR! Usage: This command is only available for scoped packages.
npm ERR! 
npm ERR! npm access public [<package>]
npm ERR! npm access restricted [<package>]
npm ERR! npm access grant <read-only|read-write> <scope:team> [<package>]
npm ERR! npm access revoke <scope:team> [<package>]
npm ERR! npm access 2fa-required [<package>]
npm ERR! npm access 2fa-not-required [<package>]
npm ERR! npm access ls-packages [<user>|<scope>|<scope:team>]
npm ERR! npm access ls-collaborators [<package> [<user>]]
npm ERR! npm access edit [<package>]
❯ npm i np@3.1 -g

❯ np --version
3.1.0

❯ np patch --yolo
  ✔ Prerequisite check
  ✔ Git
  ✔ Bumping version using npm
  ✔ Publishing package using npm
  ✔ Pushing tags

 supports-webp 1.0.7 published 🎉

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 17 (6 by maintainers)

Most upvoted comments

I’ve patched this npm-side. It will be available as part of npm@6.8.0. Sorry for the trouble, and thanks for reporting it!

@bfred-it @sindresorhus I think this can be closed now that npm v6.8.0 has been released.

Hey~

Thanks for sleuthing on this. I’ve posted on the npm.community report about the issue, and we’ll get it fixed soon. Please feel free to stick to 6.5.0 until this is fixed (which will likely be 6.8.0, which is currently in prerelease).

@franciscop you can also do:

npm i npm@latest -g

just because the latest release is now npm@6.9 👍

@itaisteinherz Please read the thread. I dug into the code of npm + tried out multiple versions of npm and discovered a regression in npm 6.6.0. If you don’t experience the problem and uses npm 6.6.0 or later, then include that info.

I am also experiencing this. I went through the git history and it looks like this command was added in PR https://github.com/sindresorhus/np/pull/201. I haven’t tried that commit yet, but I don’t think this is np’s fault. Seems to be an npm bug.

$ npx npm@6.5 access ls-collaborators
npx: installed 389 in 20.35s
{
  "sholladay": "read-write"
}

$ npx npm@6.6 access ls-collaborators
npx: installed 429 in 18.654s
npm ERR!
npm ERR! Usage: This command is only available for scoped packages.
npm ERR!
...

// cc @NeekSandhu

confirming the downgrade to 6.5 helped ;/

The only change that has happened to the relevant file in npm, lib /access.js, lately is that a commit has been merged 7 days ago, https://github.com/npm/cli/commit/b100ea8d6dd982016862223ff2c3294068b078c3#diff-b3d4d93df05cefeb70b0ea67d8a5801d, and released as part of npm 6.6.0: https://github.com/npm/cli/compare/v6.5.0...v6.6.0

I reinstalled npm 6.5.0 and the command npm access ls-collaborators np began to work again.

From the file itself it do looks like the error that we run into here is the intended since 6.6.0. Looking at the file in its 6.5.0 version paints a different picture: https://github.com/npm/cli/blob/ab0f0260e5b6333f98062fb2d9f4f9954d3ee6cd/lib/access.js

It relied on https://github.com/npm/npm-registry-client/blob/latest/lib/access.js#L82-L94, which does not require a scoped package.

So this is a regression in npm 6.6.0 and hopefully an unintended one.

I can’t find it reported at https://npm.community/c/bugs