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)
release --dry-run
# Shorthand
release -d
# Preview together with other modes
release --pr --dry-run
release --canary --dry-run
release --sync-releases --dry-runBehavior of Each Module Under --dry-run
| Module | Dry-run behavior |
|---|---|
| Shell commands | Read-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 |
| Hooks | All treated as write commands: only the command string that would run is printed, and nothing is actually executed |
| Changelog | The changelog content is calculated and generated normally, but it is not written to CHANGELOG.md |
| Contributor resolution | This 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 |
| npm | package.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 / GitLab | Token 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-PR | Does 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-releases | Does 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 plugins | Write 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-runmode
Verbose Log Levels (-V / --verbose)
Repeating -V raises the output verbosity level by level:
| Argument | Level | Output |
|---|---|---|
| Default | 0 | Standard release progress and result logs |
-V / --verbose | 1 | Additionally prints the command echoes of external commands and hooks scripts along with their stdout / stderr output |
-VV | 2 | Prints all internal and external command echoes and all verbose level logs (including Octokit / GitLab API call details) |
-VVV | 3 | Additionally outputs [DEBUG] level logs on top of -VV |
When
-V,--dry-run, orNODE_DEBUGis 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:
# 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-runEnabling 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:
NODE_ENV=development release --dry-run
# Or
DEBUG=1 release --dry-runCommon Troubleshooting
1. "Current branch is behind the upstream branch"
- Cause:
git.requireUpToDateis enabled by default, and after runninggit fetchbefore the release, the local branch was found to be behind the upstream branch. - Fix: run
git pull --rebase(orgit 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
npmplugin publishes before thegitcommit, whenpackage.jsonandCHANGELOG.mdalready 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 === trueand 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):
release --no-increment --no-npm4. 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 needsrepo, and for fine-grained tokens see GitHub Releases; GitLab needsapiand at least the Developer role on the project). - When using GitLab CI's
CI_JOB_TOKEN, make suregitlab.tokenHeader: 'JOB-TOKEN'is set as well. - For self-hosted instances, make sure
github.hostorgitlab.originis configured, and set a proxy or CA certificate if necessary.
5. Release Asset Links Uploaded to GitLab 17.2+ Are Not Accessible
- Fix: enable
gitlab.useIdsForUrls: truein the configuration, or switch togitlab.useGenericPackages: true.
6. Unsigned Git Tag Warning or CI Failure
- Check the local
git config --get tag.gpgSignandgit 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-runto 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.