How to Install and Use Lazynpm in Linux Terminal to Manage NPM Packages and Dependencies

Modern Node.js and TypeScript frontend and backend projects rely heavily on npm package management. However, managing complex package.json configurations, tracking nested dependencies, auditing security advisories, inspecting outdated packages, and running arbitrary npm scripts manually from the command line can be repetitive and fragmented. Running npm outdated, checking npm view, or parsing dependency trees via raw terminal output often requires excessive scrolling and command-line typing. lazynpm is an open-source terminal user interface (TUI) built specifically for Node.js developers. Inspired by the responsive design of lazygit and lazydocker, lazynpm consolidates project dependencies, scripts, audit reports, and remote package searches into a single interactive terminal dashboard.

What Is lazynpm and Why Use It?

lazynpm provides an intuitive, split-pane terminal UI written in Go that acts as a control deck for all npm operations inside your project repository.

Key architectural advantages of lazynpm include:

  • Interactive Dependency Explorer: View production (dependencies) and development (devDependencies) packages in real time with version status indicators.
  • One-Key Package Updating: Highlight an outdated package and press a single keyboard shortcut to update it to the latest version or specified tag.
  • Executable Script Launcher: Automatically parses the "scripts" block of your package.json, letting you execute test, build, lint, and dev servers interactively without typing full shell strings.
  • Live Security Auditing: Visualises npm audit vulnerabilities and provides interactive resolution commands.
  • Integrated Package Search: Search the global npm registry directly from your terminal and inspect package descriptions and maintainers before installation.

Installing lazynpm on Linux

You can install lazynpm using the Go toolchain or by downloading pre-compiled binary releases from GitHub.

Method 1: Installing via Go

If you have Go installed and configured in your Linux environment:

go install github.com/jesseduffield/lazynpm@latest

Ensure that your local Go binary path is exported in your shell configuration:

echo $PATH | grep -q "$HOME/go/bin" || echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Method 2: Downloading Pre-Built Binaries from GitHub

For systems without a local Go compiler, download the pre-compiled binary directly:

LAZYNPM_VER=$(curl -s "https://api.github.com/repos/jesseduffield/lazynpm/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazynpm.tar.gz "https://github.com/jesseduffield/lazynpm/releases/download/v${LAZYNPM_VER}/lazynpm_${LAZYNPM_VER}_Linux_x86_64.tar.gz"
tar -xzf lazynpm.tar.gz
sudo mv lazynpm /usr/local/bin/
rm lazynpm.tar.gz

Confirm the installation by checking the binary version:

lazynpm --version

Navigating the lazynpm Interface

To launch the dashboard, open your terminal, navigate to any Node.js project directory containing a package.json file, and run:

cd ~/projects/my-web-app
lazynpm

The interface arranges your project information into distinct interactive panels:

  1. Scripts Panel: Lists all custom npm scripts defined in package.json (e.g., build, test, dev, lint).
  2. Dependencies Panel: Displays all installed production packages alongside current and latest versions.
  3. Dev Dependencies Panel: Displays development packages and compiler tools.
  4. Information / Output Panel (Right): Shows package metadata, README extracts, or real-time build terminal output for running scripts.

Core Keyboard Shortcuts and Operations

lazynpm adheres to standard TUI navigation paradigms:

  • Tab / Shift+Tab: Switch focus between different interface panels.
  • Up / Down Arrows (or k / j): Move cursor up and down through list entries.
  • Enter: Execute the selected npm script or view package details.
  • u: Update the highlighted package to its latest release.
  • d: Uninstall / remove the highlighted dependency from package.json and node_modules.
  • a: Open the prompt to add/install a new package to the project.
  • q: Exit lazynpm.

Running and Monitoring Build Scripts

Rather than opening multiple terminal windows to run development servers and build jobs, you can manage scripts directly in lazynpm:

  1. Navigate to the Scripts panel using Tab.
  2. Highlight your target script (such as dev or watch).
  3. Press Enter to launch the background process.
  4. The right-hand pane streams stdout and stderr logs in real time. Press x to stop or kill a running process.

Auditing and Managing Vulnerabilities

lazynpm flags insecure packages with visual warning indicators. Selecting a flagged dependency displays the specific CVE advisory and severity ranking, allowing you to run automated patches or upgrade major versions without leaving the terminal view.

Integrating lazynpm into your everyday Linux developer workflow consolidates dependency management, accelerates script execution, and simplifies project maintenance.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.