Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anru opened this issue Mar 1, 2021 · 4 comments
Closed

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

anru opened this issue Mar 1, 2021 · 4 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@anru
Copy link

anru commented Mar 1, 2021

Current Behavior:

npm publish path/to/pkg command in monorepository executed for package without repository field trying to do git ls-remote on ssh://git@github.com/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://git@github.com/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'
}
@anru anru added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Mar 1, 2021
@anru
Copy link
Author

anru commented Mar 1, 2021

Bug is reproducible for v7.6.0 also

@anru anru changed the title [BUG] npm publish trying to execute ls-remote even in dry-run mode [BUG] Failed to publish packages without repository field Mar 30, 2021
@smnbbrv
Copy link

smnbbrv commented Apr 9, 2021

Just had the same issue and resolved it by adding dot in front of directory:

npm publish ./src/test-pkg

This resolved the issue

@darcyclarke
Copy link
Contributor

@anru as @smnbbrv notes, the correct syntax/format for publish here is to include the correct path (ie. ./ at the beginning of your package dir)

@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Apr 9, 2021
@smnbbrv
Copy link

smnbbrv commented Apr 9, 2021

Well, it was working before without the dot. That's a weird thing. However, good that solution is found :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants