$ npm install -g clang-format
added 19 packages, and audited 20 packages in 569ms
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm list -g
/home/username/.node/lib
└── [email protected]
$ ls /home/username/.node/lib/node_modules/clang-format/bin/linux_x64/clang-format
/home/username/.node/lib/node_modules/clang-format/bin/linux_x64/clang-format
$ /home/username/.node/lib/node_modules/clang-format/bin/linux_x64/clang-format --version
clang-format version 15.0.0 (https://github.com/llvm/llvm-project.git 596752863e27e6b4b89e34ecfcf5317a5bf46b52)
$ sudo apt-get install clang-format -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
clang-format-14 libbsd0 libclang-cpp14 libedit2 libexpat1 libicu70 libllvm14 libmd0 libmpdec3 libpython3-stdlib libpython3.10-minimal libpython3.10-stdlib libreadline8
libsqlite3-0 libxml2 media-types python3 python3-minimal python3.10 python3.10-minimal readline-common
Suggested packages:
python3-doc python3-tk python3-venv python3.10-venv python3.10-doc binutils binfmt-support readline-doc
The following NEW packages will be installed:
clang-format clang-format-14 libbsd0 libclang-cpp14 libedit2 libexpat1 libicu70 libllvm14 libmd0 libmpdec3 libpython3-stdlib libpython3.10-minimal libpython3.10-stdlib
libreadline8 libsqlite3-0 libxml2 media-types python3 python3-minimal python3.10 python3.10-minimal readline-common
0 upgraded, 22 newly installed, 0 to remove and 5 not upgraded.
Need to get 36.1 MB/54.1 MB of archives.
After this operation, 230 MB of additional disk space will be used.
<snip>
Setting up clang-format-14 (1:14.0.0-1ubuntu1) ...
Setting up clang-format:amd64 (1:14.0-55~exp2) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ..
$ which clang-format
/usr/bin/clang-format
$ clang-format --version
clang-format version 10.0.0-4ubuntu1