CLI

AxilJS CLI Troubleshooting: Installation, Build, Test and Runtime Issues

Troubleshoot common AxilJS CLI issues, including command-not-found errors, installation and update problems, project dependencies, development server, build, test, deployment, and decorator CLI issues.

6 min readDocumentationEdit this page

AxilJS CLI Troubleshooting

This guide covers common issues when installing, updating, and using the AxilJS CLI.

The recommended troubleshooting process is to first verify the installed CLI version, run axil doctor, verify project dependencies, and then retry the command that produced the error.

axil Command Not Found

If your terminal reports that axil is not recognized or the command cannot be found, first install the AxilJS CLI globally:

Terminal
npm install -g @axiljs/cli

Then verify the installation:

Terminal
axil --version

If the command is still unavailable, the npm global binary directory may not be included in your system PATH.

Restart your terminal after installation and try again.

On Windows, you can close and reopen Command Prompt, PowerShell, or Windows Terminal so the updated environment is loaded.

Check the Installed CLI Version

Display the currently installed AxilJS CLI version:

Terminal
axil --version

If you need to update the CLI to the latest published version:

Terminal
npm install -g @axiljs/cli@latest

Then verify the installed version:

Terminal
axil --version

Checking the version is an important first step when troubleshooting differences between environments or unexpected CLI behavior.

Reinstall the CLI

If the global CLI installation appears corrupted or behaves unexpectedly, uninstall it:

Terminal
npm uninstall -g @axiljs/cli

Install the CLI again:

Terminal
npm install -g @axiljs/cli

Verify the installation:

Terminal
axil --version

This provides a clean global installation of the AxilJS CLI.

Project Dependencies

If an AxilJS project fails to start, make sure its project dependencies are installed.

Run:

Terminal
npm install

Then start the development server:

Terminal
axil run

Run these commands from the root directory of the AxilJS project.

Custom Entry Point Problems

If the CLI cannot find or start the expected application entry point, provide the entry point explicitly:

Terminal
axil run src/mvc/main.ts

Make sure that:

  • The specified file exists.
  • The file is a valid TypeScript entry module.
  • You are running the command from the project root.

A custom entry point is useful when the project uses a non-standard application structure.

Development Server Issues

Start the development server with:

Terminal
axil run

If the project uses a custom entry point:

Terminal
axil run src/mvc/main.ts

If the application still fails to start, run the diagnostic command:

Terminal
axil doctor

The diagnostic command can help identify project, environment, dependency, or CLI-related problems.

Build Issues

If the production build fails, first ensure that project dependencies are installed:

Terminal
npm install

Then run:

Terminal
axil build

Review the compiler output for TypeScript or application-level errors.

The AxilJS CLI build command does not replace fixing errors in the application source itself. If the compiler reports source-level errors, resolve those errors and run the build again.

Test Issues

Run the complete test suite:

Terminal
axil test

To target a particular test pattern:

Terminal
axil test <pattern>

For example:

Terminal
axil test user

Review the test runner output for the underlying test or configuration error.

If the issue is not related to a specific test pattern, run the complete test suite to determine whether the problem affects the project generally.

Deployment Issues

Generate deployment artifacts with:

Terminal
axil deploy

The command generates Docker and Kubernetes configuration files.

If deployment generation fails, run:

Terminal
axil doctor

Then verify that the project is correctly installed and configured.

Review generated deployment files before using them in a production environment.

Decorator CLI Issues

If the AxilJS decorator catalog does not behave as expected, first verify the installed CLI version:

Terminal
axil --version

Inspect the available decorator categories:

Terminal
axil decorator categories

List the available decorators:

Terminal
axil decorator list

Inspect a specific decorator:

Terminal
axil decorator info tAuth

Search the catalog:

Terminal
axil decorator search authentication

If you recently updated the decorator catalog, make sure you are using the latest published CLI version:

Terminal
npm install -g @axiljs/cli@latest

Then verify:

Terminal
axil --version

This is particularly important when the locally installed CLI contains an older version of the decorator catalog.

Decorator Check Errors

Use the check command to inspect decorator composition in a source file:

Terminal
axil decorator check src/controllers/user.controller.ts

Make sure the file path is correct and that the source file contains the decorators you expect the CLI to analyze.

You can also inspect the decorator metadata graph:

Terminal
axil decorator graph src/controllers/user.controller.ts

The graph can help inspect relationships between semantic decorators and their associated metadata.

Package Installation Issues

If an AxilJS package cannot be installed through the CLI:

Terminal
axil install <package>

Try installing the package directly with npm:

Terminal
npm install <package>

For example:

Terminal
npm install @axiljs/decorator

If the package is already installed, inspect the project's dependency tree:

Terminal
npm list @axiljs/decorator

This can help determine whether the expected package version is installed in the current project.

Diagnose the Environment

The recommended first diagnostic command is:

Terminal
axil doctor

Run it from the root directory of your AxilJS project:

Terminal
cd my-api
axil doctor

Use doctor when investigating project configuration, environment, dependency, or CLI-related issues.

Get CLI Help

Display the complete CLI command reference:

Terminal
axil --help

For a specific command:

Terminal
axil run --help
Terminal
axil build --help
Terminal
axil decorator --help

Command-specific help can reveal available options and expected command syntax.

Windows Troubleshooting

On Windows, AxilJS CLI commands can be executed from Command Prompt, PowerShell, or Windows Terminal.

For example:

Terminal
npm install -g @axiljs/cli@latest
axil --version
axil doctor

If axil is not recognized immediately after installation, close and reopen the terminal so that the updated environment and PATH configuration are loaded.

If the command remains unavailable after restarting the terminal, verify the global npm installation and the npm global binary directory configuration.

Diagnostic Workflow

When troubleshooting an AxilJS CLI issue, start with the installed CLI version:

Terminal
axil --version

Then diagnose the project environment:

Terminal
axil doctor

Verify project dependencies:

Terminal
npm install

Retry the command that produced the error:

Terminal
axil run

For production build problems:

Terminal
axil build

For decorator tooling problems:

Terminal
axil decorator categories
axil decorator list

The troubleshooting sequence can be summarized as:

text
Check CLI Version
       │
       ▼
  axil doctor
       │
       ▼
 npm install
       │
       ▼
Retry Failed Command
       │
   ┌───┼────────────┐
   ▼   ▼            ▼
  run build      decorator

This workflow helps separate global CLI installation problems from project dependency, configuration, development server, build, deployment, and decorator-catalog issues.

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY