Skip to content

Dry Runs, Debugging and Troubleshooting ​

Before actually modifying the repository, pushing tags, or publishing an npm package, it is a good idea to use dry-run mode and verbose logs to confirm what each step does.

Dry-Run Mode (-d / --dry-run) ​

bash
release --dry-run
# Shorthand
release -d
# Preview together with other modes
release --pr --dry-run
release --canary --dry-run
release --sync-releases --dry-run

Behavior of Each Module Under --dry-run ​

ModuleDry-run behavior
Shell commandsRead-only commands (write: false, such as git rev-parse, git describe, git status) run normally to collect the real context; write commands (such as git commit, git tag, git push, npm version) do not run and are only printed with a ! prefix
HooksAll treated as write commands: only the command string that would run is printed, and nothing is actually executed
ChangelogThe changelog content is calculated and generated normally, but it is not written to CHANGELOG.md
Contributor resolutionThis is a read-only operation and still runs during a dry run: it really calls gh auth token to read the local gh CLI credentials and makes read-only requests to the GitHub API / ungh.cc to resolve contributors' GitHub usernames (nothing is written). To stay offline, pass --no-changelog.contributorsLookup or set NEOS_RELEASE_OFFLINE=1
npmpackage.json is not modified (and the automatic npm login is not triggered), but npm publish --dry-run is called with the --dry-run argument for a real packaging check; in npm.stage mode a notice is printed that the package would be submitted to the staging queue
GitHub / GitLabToken authentication / collaborator API checks are skipped; no Release is created or updated, no assets are uploaded, and no comments are posted. Only the equivalent calls and the expected links are printed
Release-via-PRDoes not actually switch branches, commit, or push, and does not call the PR/MR write APIs; only the expected PR/MR operations and links are printed
--sync-releasesDoes not create or update remote Releases; if a token is configured, the remote state is queried read-only and the sync plan is printed
External pluginsWrite commands executed through this.exec are skipped automatically; logic that reads or writes files directly must check this.config.isDryRun in the plugin itself

Meaning of the Command-Line Output Prefixes ​

In --dry-run or verbose output mode, command echoes use the following prefixes:

  • $ <command>: a command that is actually executed ([cached] after it means the read-only command cache for this run was hit)
  • ! <command>: a write command or API operation that is skipped in --dry-run mode

Verbose Log Levels (-V / --verbose) ​

Repeating -V raises the output verbosity level by level:

ArgumentLevelOutput
Default0Standard release progress and result logs
-V / --verbose1Additionally prints the command echoes of external commands and hooks scripts along with their stdout / stderr output
-VV2Prints all internal and external command echoes and all verbose level logs (including Octokit / GitLab API call details)
-VVV3Additionally outputs [DEBUG] level logs on top of -VV

When -V, --dry-run, or NODE_DEBUG is enabled, the step progress animation (spinner) is disabled automatically so that logs are printed line by line without overwriting each other.

Deep Debugging (NODE_DEBUG and Stack Traces) ​

Enabling NODE_DEBUG ​

@neosjs/release uses Node.js's built-in util.debuglog to print low-level debug information, with namespace filtering:

bash
# Enable all debug logs
NODE_DEBUG=@neosjs/release:* release --dry-run

# Debug config loading and merging only
NODE_DEBUG=@neosjs/release:config release --dry-run

# Debug shell subprocess execution only (exit code, stdout, stderr)
NODE_DEBUG=@neosjs/release:shell release --dry-run

# Debug plugin loading and initialization only
NODE_DEBUG=@neosjs/release:plugins release --dry-run

Enabling NODE_DEBUG=@neosjs/release:config also turns on the Octokit client's debug logs and the conventional-changelog debug callback.

Printing Full Error Stack Traces ​

By default, the cause of an error is normalized and indented, then printed once, hiding the lengthy stack trace. When troubleshooting internal errors, set NODE_ENV=development or DEBUG=1 to include the full stack trace:

bash
NODE_ENV=development release --dry-run
# Or
DEBUG=1 release --dry-run

Common Troubleshooting ​

1. "Current branch is behind the upstream branch" ​

  • Cause: git.requireUpToDate is enabled by default, and after running git fetch before the release, the local branch was found to be behind the upstream branch.
  • Fix: run git pull --rebase (or git pull) to sync the latest commits before releasing; if you really need to skip the check, pass --no-git.requireUpToDate.

2. ERR_PNPM_GIT_UNCLEAN when Publishing with pnpm ​

  • Cause: the npm plugin publishes before the git commit, when package.json and CHANGELOG.md already have changes, and pnpm requires a clean working tree by default.
  • Fix: add npm.publishArgs: ['--no-git-checks'] to the configuration.

3. npm Publish Succeeded but git push Failed ​

  • Behavior: the tool detects that isReleased === true and automatically disables the rollback to preserve the local commit and tag, so the local and published versions do not diverge.
  • Fix: after fixing the network or the remote branch permissions, run the following command to push the commits and tags (the version is not incremented again and npm is not published again):
bash
release --no-increment --no-npm

4. GitHub / GitLab Reports Failed Authentication or Not a Collaborator ​

  • Check that the corresponding environment variable (by default GITHUB_TOKEN / GITLAB_TOKEN) has been exported correctly to the current shell and that the permissions are sufficient (a GitHub classic token needs repo, and for fine-grained tokens see GitHub Releases; GitLab needs api and at least the Developer role on the project).
  • When using GitLab CI's CI_JOB_TOKEN, make sure gitlab.tokenHeader: 'JOB-TOKEN' is set as well.
  • For self-hosted instances, make sure github.host or gitlab.origin is configured, and set a proxy or CA certificate if necessary.
  • Fix: enable gitlab.useIdsForUrls: true in the configuration, or switch to gitlab.useGenericPackages: true.

6. Unsigned Git Tag Warning or CI Failure ​

  • Check the local git config --get tag.gpgSign and git config --get tag.forceSignAnnotated, as well as the status of the GPG / SSH key agent (see Git Integration - Tag Signing).
  • If you really need to force signing off, configure git.tagArgs: ['--annotate', '--no-sign'].

7. The Configuration File Does Not Take Effect or "Invalid configuration file" Is Reported ​

  • Use NODE_DEBUG=@neosjs/release:config release --dry-run to see which configuration file is actually loaded and the final merged result.
  • Check that nested CLI arguments use the exact camelCase spelling (such as --git.requireCleanWorkingDir, not --git.require-clean-working-dir).
  • Note that array fields replace the default values as a whole rather than being appended.