sindresorhus/np

npm 9.0.0 Support?

karlhorky opened this issue ยท 4 comments

Hi @sindresorhus, thanks for the amazing np ๐Ÿ™Œ Great package.

Description

It seems that np@7.6.2 fails on npm@^9.0.0 (now stable), because internally it is calling npm access ls-collaborators ... commands, with the error message ls-collaborators is not a valid access command:

$ np --yolo

...

? Select semver increment or specify new version patch 	3.3.9

  โฏ Prerequisite check
    โœ” Ping npm registry
    โœ” Check npm version
    โœ” Check yarn version
    โœ– Verify user is authenticated
      โ†’ npm ERR!     /Users/k/.npm/_logs/2022-11-14T13_52_40_574Z-debug-0.log
      Check git version
      Check git remote
      Validate version
      Check for pre-release version
      Check git tag existence
    Git
    Bumping version using Yarn
    Publishing package using Yarn
    Pushing tags
    Creating release draft on GitHub

โœ– Command failed with exit code 1: npm access ls-collaborators @upleveled/eslint-config-upleveled
npm ERR! code EUSAGE
npm ERR!
npm ERR! ls-collaborators is not a valid access command
npm ERR!
npm ERR! Set access level on published packages
npm ERR!
npm ERR! Usage:
npm ERR! npm access list packages [<user>|<scope>|<scope:team> [<package>]
npm ERR! npm access list collaborators [<package> [<user>]]
npm ERR! npm access get status [<package>]
npm ERR! npm access set status=public|private [<package>]
npm ERR! npm access set mfa=none|publish|automation [<package>]
npm ERR! npm access grant <read-only|read-write> <scope:team> [<package>]
npm ERR! npm access revoke <scope:team> [<package>]
npm ERR!
npm ERR! Options:
npm ERR! [--json] [--otp <otp>] [--registry <registry>]
npm ERR!
npm ERR! Run "npm help access" for more info

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/k/.npm/_logs/2022-11-14T13_52_40_574Z-debug-0.log

Aborted!

The command alone also fail on npm@^9.0.0 with the same error message:

$  npm access ls-collaborators @upleveled/eslint-config-upleveled
npm ERR! code EUSAGE
npm ERR!
npm ERR! ls-collaborators is not a valid access command
npm ERR!
npm ERR! Set access level on published packages
npm ERR!
npm ERR! Usage:
npm ERR! npm access list packages [<user>|<scope>|<scope:team> [<package>]
npm ERR! npm access list collaborators [<package> [<user>]]
npm ERR! npm access get status [<package>]
npm ERR! npm access set status=public|private [<package>]
npm ERR! npm access set mfa=none|publish|automation [<package>]
npm ERR! npm access grant <read-only|read-write> <scope:team> [<package>]
npm ERR! npm access revoke <scope:team> [<package>]
npm ERR!
npm ERR! Options:
npm ERR! [--json] [--otp <otp>] [--registry <registry>]
npm ERR!
npm ERR! Run "npm help access" for more info

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/k/.npm/_logs/2022-11-14T13_54_03_856Z-debug-0.log

Steps to reproduce

  1. Install np@7.6.2 and npm@^9.0.0
  2. Attempt to use np
  3. See error message above

Expected behavior

np should work with the latest stable npm

Environment

np - 7.6.2
Node.js - 18.12.1
npm - 9.1.1
Git - 2.38.1
OS - macOS Ventura 13.0.1

After checking the code and the release notes of npm v9.0.0, it seems to me that the npm access subcommands have changed in a way that breaks this application.

I would like to contribute and fix this error.
Is there a guide of contribution which I should adhere to, @sindresorhus ?

Is there a guide of contribution which I should adhere to, @sindresorhus ?

No. Just the usual. Make sure that npm test passes locally and to review your own diff (good way to catch obvious mistakes).

Is this fixed? I'm getting this exact error with:

  • npm 9.5.1
  • node 18.16.1
  • np 8.0.4
0x80 commented

I ran into this error with npm 10 node 20. My tests were passing. I ended up publishing with plain npm commands.