release-it: Cannot publish npm package from release-it

Hi, when I try to manually publish the npm package everything works fine. But when I execute the release-it command I get the following error:

ERROR Unable to reach npm registry (timed out after 10000ms).

release-it --dry-run give my this

release-it --dry-run
! npm ping
! npm whoami
$ npm show instancequeue@latest version
WARNING No version found in npm registry. Assuming new package.
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD
$ git config --get branch.master.remote
$ git remote get-url origin
! git fetch
$ git describe --tags --abbrev=0
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/master
! git log --pretty=format:"* %s (%h)"

🚀 Let's release instancequeue (currently at 1.1.10)


Empty changelog

? Select increment (next version): patch (1.1.11)
! npm version 1.1.11 --no-git-tag-version
$ git status --short --untracked-files=no

Empty changeset

!
? Commit (Release 1.1.11)? Yes
!
? Tag (1.1.11)? Yes
!
? Push? Yes
$ git symbolic-ref HEAD [cached]
$ git for-each-ref --format="%(upstream:short)" refs/heads/master [cached]
!
? Publish instancequeue to npm? Yes
$ npm publish . --tag latest   --dry-run
ERROR Error
    at /usr/local/lib/node_modules/release-it/lib/shell.js:67:18
    at /usr/local/lib/node_modules/release-it/node_modules/shelljs/src/exec.js:127:9
    at ChildProcess.exithandler (child_process.js:315:5)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
Rolling back changes...
! git tag --delete 1.1.11
! git reset --hard HEAD~1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 24

Commits related to this issue

Most upvoted comments

I added the npm.publishArgs option in v14.5.0 so you can do something like this to work around the issue:

release-it --npm.publishArgs="--registry=https://registry.npmjs.org"

@webpro I believe @dcharbonnier may have been referencing https://github.com/npm/cli/issues/2525: a bug in npm where publishConfig.registry was not being detected correctly when publishing. The issue has since been fixed. But if anyone is using the npm version with that bug, they’d need to explicitly set the publishPath via command line arg, which you’re now supporting. Hope this helps!

This is possibly related to https://github.com/release-it/release-it/issues/637. I only seem to run into this issue when using release-it against a private npm registry (we’re using artifactory).