npm / npm/cli

[BUG] when publishing a scoped module to an org that doesn't exist, npm is a bit too helpful

Open
#4,773 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior
  • I want to publish @myspace/bnb
  • I verify that @myspace is not taken as a scope
  • I create my package and run npm publish --access public
  • npm "helpfully" tells me that @myspace/bnb is not published and that I should ask the maintainer to publish it or do so myself
    • that is what I'm trying to do?
Expected Behavior
  • I want to publish @myspace/bnb
  • I verify that @myspace is not taken as a scope
  • I create my package and run npm publish --access public
  • npm tells me that @myspace/bnb cannot be published by me because the organization does not exist and that I should go create the organization before trying to publish it
Steps To Reproduce
  1. create package under a scope of an org that doesn't exist
  2. try to publish
  3. get told that the publish failed and that you should try to publish
Environment
  • npm: 8.5.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by reproducing npm publish for a scoped package whose organization does not exist, using npm 8.5.3 or the current CLI, then trace the publish error-handling entry point. Done means the command clearly says the organization does not exist and advises creating it before retrying.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.