nodeunit command not found

In this troubleshooting guide we learn how to fix nodeunit command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

nodeunit: command not found

or when using sudo you get the following error message

sudo: nodeunit: command not found

Solutions to nodeunit: command not found

How To Fix nodeunit: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu nodeunit is provided by nodeunit package.

nodeunit is:

This package provides easy async unit testing for Node.js and the browser.

Particularly, this module:

  • Is simple to use,
  • Just exports the tests from a module,
  • Works with node.js and in the browser,
  • Helps you avoid common pitfalls when testing asynchronous code,
  • Allows one to easily add test cases with setUp and tearDown functions,
  • Adds flexible reporters for custom output, built-in support for HTML & jUnit XML,
  • Allows one to use mocks and stubs.

Node.js is an event-based server-side JavaScript engine.

To fix this problem, we can install more using the command below.

sudo apt-get -y install nodeunit

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install nodeunit.

sudo apt -y install nodeunit

Or if you have aptitude installed you can use the following command.

sudo aptitude install nodeunit

Summary

In this tutorial we learn how to fix nodeunit command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.