webpack command not found

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

Introduction

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

webpack: command not found

or when using sudo you get the following error message

sudo: webpack: command not found

Solutions to webpack: command not found

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

In Ubuntu webpack is provided by webpack package.

webpack is:

Webpack takes code targeted at node.js and makes it run in the browser. Node.js comes with API of its own that is not available in the browsers. Webpack exposes this code to programs that are unaware they are running in a browser.

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 webpack

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

You can also use apt command to install webpack.

sudo apt -y install webpack

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

sudo aptitude install webpack

Summary

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