jsesc command not found

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

Introduction

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

jsesc: command not found

or when using sudo you get the following error message

sudo: jsesc: command not found

Solutions to jsesc: command not found

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

In Ubuntu jsesc is provided by node-jsesc package.

node-jsesc is:

Escapes JavaScript strings while generating the shortes possible valid ASCII-only output. This can be used to avoid various encoding issues.

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 node-jsesc

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

You can also use apt command to install node-jsesc.

sudo apt -y install node-jsesc

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

sudo aptitude install node-jsesc

Summary

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