json5 command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
json5: command not found
or when using sudo you get the following error message
sudo: json5: command not found
Solutions to json5: command not found
How To Fix json5: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu json5 is provided by node-json5 package.
node-json5 is:
JSON5 is a proposed extension to JSON that aims to make it easier for humans to write and maintain by hand. It does this by adding some minimal syntax features directly from ECMAScript 5.
JSON5 remains a strict subset of JavaScript, adds no new data types, and works with all existing JSON content.
JSON5 is not an official successor to JSON, and JSON5 content may not work with existing JSON parsers. For this reason, JSON5 files use a new .json5 extension. (TODO: new MIME type needed too.)
The code here is a reference JavaScript implementation for both Node.js and all browsers. It’s based directly off of Douglas Crockford’s own JSON implementation, and it’s both robust and secure.
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-json5
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install node-json5.
sudo apt -y install node-json5
Or if you have aptitude installed you can use the following command.
sudo aptitude install node-json5
Summary
In this tutorial we learn how to fix json5 command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.