Skip to content

[BUG] Failed to publish packages without repository field #2796

Closed
@anru

Description

@anru

Current Behavior:

npm publish path/to/pkg command in monorepository executed for package without repository field trying to do git ls-remote on ssh://[email protected]/path/to/pkg.git and fails.

Some in --dry-run mode

Expected Behavior:

The success of the 'npm publish' command does not depend on the presence of a package in any DVCS. At least some ENV variable to disable communication with DVCS would be nice.

Steps To Reproduce:

  1. Create a "src/test-pkg" directory for example
  2. Write package.json with dead simple config { "name": "test-pkg", "version": "0.0.1" }
  3. Run npm publish --dry-run src/test-pkg or npm publish src/test-pkg
  4. See error:
npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://[email protected]/src/test-pkg.git
npm ERR! ERROR: Repository not found.

Environment:

OS: mac os 10.15.7

npm version is

{
  npm: '7.5.3',
  node: '15.8.0',
  v8: '8.6.395.17-node.23',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.17.1',
  modules: '88',
  nghttp2: '1.42.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1i',
  cldr: '38.1',
  icu: '68.2',
  tz: '2020d',
  unicode: '13.0'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions