Skip to main content

Installation

Devark is distributed as an npm package and can be installed globally or used directly with npx. This guide covers all installation methods and helps you verify your setup.

System Requirements

Before installing Devark, ensure your system meets these requirements:
  • Node.js version 18 or higher
  • One of the following package managers:
    • npm (comes with Node.js)
    • pnpm
    • yarn
    • bun
Check your Node.js version with node --version. If you need to upgrade, visit nodejs.org.

Installation Methods

The easiest way to use Devark is with npx, which doesn’t require installation:
npx devark add google-oauth
This downloads and runs the latest version of Devark automatically. Perfect for occasional use or trying out Devark.
Using npx ensures you always run the latest version without manual updates.

Global Installation

For frequent use, install Devark globally to use it anywhere:
npm install -g devark
After global installation, the devark command is available system-wide:
devark add google-oauth

Local Project Installation

You can also install Devark as a dev dependency in your project:
npm install --save-dev devark
Then run it via package.json scripts or npx:
npx devark add google-oauth

Verify Installation

Confirm Devark is installed correctly by checking the version:
devark --version
You should see output similar to:
1.1.1
To see all available commands:
devark --help
Expected output:
Usage: devark [options] [command]

Devark CLI - Modular backend scaffolder

Options:
  -V, --version      output the version number
  -h, --help         display help for command

Commands:
  add <module>       Add a backend module to your project
  help [command]     display help for command

Troubleshooting

Command not found

If you get devark: command not found after global installation: For npm:
# Check npm global bin directory
npm bin -g

# Add it to your PATH if needed
export PATH="$(npm bin -g):$PATH"
For pnpm:
# Ensure pnpm global bin is in PATH
pnpm setup
For yarn:
# Check yarn global bin directory
yarn global bin

# Add to PATH
export PATH="$(yarn global bin):$PATH"
Add the export command to your shell configuration file (.bashrc, .zshrc, etc.) to make it permanent.

Permission errors (Linux/macOS)

If you encounter permission errors during global installation:
# Option 1: Use a Node version manager (recommended)
nvm install node
nvm use node

# Option 2: Change npm's default directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH

Windows installation issues

On Windows, you may need to run your terminal as Administrator for global installations. Alternatively, use a package manager like Scoop or Chocolatey to manage Node.js and avoid permission issues.

Module not found errors

If Devark runs but shows “Module not found” errors:
  1. Ensure you’re in a Node.js project directory with package.json
  2. Run npm install to ensure all dependencies are installed
  3. Try reinstalling Devark

Development Setup

If you want to contribute to Devark or test local changes:
# Clone the repository
git clone https://github.com/huzfm/Devark.git
cd Devark

# Install dependencies
pnpm install

# Link globally for testing
pnpm link --global
Now you can run your local development version:
devark add google-oauth
The Devark repository uses pnpm for dependency management. Make sure you have pnpm installed for development.

Updating Devark

To update to the latest version:
npm update -g devark

Next Steps

Now that Devark is installed, you’re ready to start adding features to your project:

Quickstart Tutorial

Follow a step-by-step guide to add Google OAuth to your project

Build docs developers (and LLMs) love