Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

mj app remove/enable/disable print a second failure line and exit 2 (EEXIT: 1) on any failure

Open Beginner friendly
#5,930 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
nodejs, typescript
Domain
cli, testing

Research direction

Read the three command files named in the issue and compare their failure handling with install.ts and upgrade.ts. Extend packages/MJCLI/src/tests/app-command-exit.test.ts for remove, enable, and disable, mocking the engine to return Success: false. Run those tests and the three repro commands; done means each prints one failure line and exits 1.

Written by the indexing model from the issue text.

Description

Found by the PR gauntlet on #4522 (fix/4505-private-repo-auth), 2026-10-20. Not caused by that PR: verified pre-existing at 426af00876. #4522 fixed the same defect in install.ts and upgrade.ts only.

Where
  • packages/MJCLI/src/commands/app/remove.ts:89
  • packages/MJCLI/src/commands/app/enable.ts:43
  • packages/MJCLI/src/commands/app/disable.ts:43
What happens

When the engine returns Success: false, each command calls this.exit(1) inside its try. oclif implements exit() by throwing ExitError (message EEXIT: 1). The command's own generic catch catches it, prints a second failure line, and calls this.error('EEXIT: 1'). That raises a new CLIError with the default exit code 2.

The output is:

✖ Remove failed: App 'x' is not installed
✖ Remove failed
 ›   Error: EEXIT: 1

The process exits 2, not 1.

Why it matters

Scripts and CI that read the exit code get 2 for an ordinary failure. Users see a duplicate failure line and the internal string EEXIT: 1. After #4522, mj app install and mj app upgrade exit 1 once for the same kind of failure, so the mj app command family is now inconsistent.

Repro
node packages/MJCLI/bin/run.js app remove gauntlet-no-such-app --force; echo "exit=$?"
node packages/MJCLI/bin/run.js app disable gauntlet-no-such-app; echo "exit=$?"
node packages/MJCLI/bin/run.js app enable gauntlet-no-such-app; echo "exit=$?"

Each fails before any database write (the app lookup returns no row).

Evidence

The same mechanism on mj app install at 426af00876: a double "✖ Install failed" line, then › Error: EEXIT: 1, then exit 2. The #4522 fix and its test are packages/MJCLI/src/commands/app/install.ts (exit after the try/catch) and packages/MJCLI/src/__tests__/app-command-exit.test.ts.

Suggested fix

Do what #4522 did for install and upgrade. Set a failed flag in the else branch, and call this.exit(1) after the try/catch, not inside it. Extend app-command-exit.test.ts with remove, enable and disable cases (mock the engine to return Success: false, then assert error.oclif.exit === 1).

Definition of done
  • A failing test for each of the three commands, then green
  • Each repro command prints one failure line and exits 1
  • Existing MJCLI suite and repo gates green; no changed expectation in an existing test
Verify by

Run the three repro commands. Each prints exactly one ✖ … failed: line and exit=1.

Dominant language
TSQL
Stars
32
Forks
7
Avg merge
1d 11h
Merged PRs (30d)
714

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MemberJunction/MJ

All issues in MemberJunction/MJ

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.