This is not an error. Your tar is outdated. To fix this issue run this command: npm i tar and enter ok. Now your problem of npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. will be fixed.

Answer from user62137 on Stack Overflow
🌐
npm
npmjs.com › package › tar
tar - npm
March 23, 2026 - tar for node. Latest version: 7.5.13, last published: a month ago. Start using tar in your project by running `npm i tar`. There are 6453 other projects in the npm registry using tar.
      » npm install tar
    
Published   Mar 23, 2026
Version   7.5.13
🌐
npm
npmjs.com › search
tar - npm search
Zero dependency streaming tar parser and writer for JavaScript.
🌐
npm
npmjs.com › package › node-tar
node-tar - npm
Latest version: 1.0.0, last published: 3 years ago. Start using node-tar in your project by running `npm i node-tar`. There are 5 other projects in the npm registry using node-tar.
      » npm install node-tar
    
Published   Nov 08, 2022
Version   1.0.0
🌐
GitLab
advisories.gitlab.com › pkg › npm › tar
Npm/Tar | GitLab Advisory Database (GLAD)
node-tar aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. The npm package "tar" (aka node-tar) has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. node-tar aims to guarantee that any file whose location would ...
🌐
Debian
packages.debian.org › bullseye › node-tar
Debian -- Details of package node-tar in bullseye
node-tar is able to read and write tar archives generated by bsdtar, gnutar, solaris posix tar, and "Schilly" tar. node-tar is a well-tested essential piece of software for npm, the Node.js package manager.
🌐
GitHub
github.com › isaacs › node-tar › blob › main › CHANGELOG.md
node-tar/CHANGELOG.md at main · isaacs/node-tar
Entirely new API surface, tar.c(), tar.x() etc., much closer to system tar semantics · Massive performance improvement · Require node 4.x and higher · fstream-based implementation · slow and kinda bad, but better than npm shelling out to the system tar
Author   isaacs
🌐
GitHub
github.com › isaacs › node-tar
GitHub - isaacs/node-tar: tar for node · GitHub
If you are familiar with how tar works, most of this will hopefully be straightforward for you. If not, then hopefully this module can teach you useful unix skills that may come in handy someday :) Significant efforts have been taken to harden this library against a wide variety of filesystem based attacks, especially as it is used to unpack packages that are published by unknown agents to the npm ...
Starred by 911 users
Forked by 255 users
Languages   JavaScript 55.3% | TypeScript 44.6% | Shell 0.1%
Find elsewhere
🌐
GitHub
github.com › npm › cli › issues › 8922
[BUG] Vulnerability CVE-2026-23745 in "node-tar" 7.5.2 dependency in npm · Issue #8922 · npm/cli
January 20, 2026 - "tar" dependency in npm should be updated to "7.5.3" to address CVE-2026-23745 (https://nvd.nist.gov/vuln/detail/CVE-2026-23745 ) In this environment: nodejs 20.19.5 or higher and npm 11.7.0
Author   darrentma
🌐
Tenable
tenable.com › plugins › nessus › 192685
Node.js Module node-tar < 6.2.1 DoS<!-- --> | Tenable®
March 29, 2024 - In the nodejs module node-tar prior to version 6.2.1, there is no validation of the number of folders created while unpacking a file. As a result, an attacker can use a malicious file to exhaust the CPU and memory on the host and crash the nodejs client.
🌐
npm
npmjs.com › package › node-tar.gz
node-tar.gz - npm
Pure javascript tarball tools for Node.js. Latest version: 1.0.0, last published: 11 years ago. Start using node-tar.gz in your project by running `npm i node-tar.gz`. There are 3 other projects in the npm registry using node-tar.gz.
      » npm install node-tar.gz
    
Published   Aug 09, 2015
Version   1.0.0
🌐
Debian
packages.debian.org › sid › node-tar
Debian -- Details of package node-tar in sid
node-tar is able to read and write tar archives generated by bsdtar, gnutar, solaris posix tar, and "Schilly" tar. node-tar is a well-tested essential piece of software for npm, the Node.js package manager.
🌐
npm
npmjs.com › package › tar-stream
tar-stream - npm
February 28, 2026 - tar-stream is a streaming tar parser and generator and nothing else. It operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system..
      » npm install tar-stream
    
Published   Feb 28, 2026
Version   3.1.8
Author   Mathias Buus
🌐
npm
npmjs.com › package › tar-fs
tar-fs - npm
March 4, 2026 - const tar = require('tar-fs') const fs = require('fs') // packing a directory tar.pack('./my-directory').pipe(fs.createWriteStream('my-tarball.tar')) // extracting a directory fs.createReadStream('my-other-tarball.tar').pipe(tar.extract('./...
      » npm install tar-fs
    
Published   Mar 04, 2026
Version   3.1.2
🌐
npm
npmjs.com › package › @types › tar
@types/tar - npm
This package contains type definitions for tar (https://github.com/npm/node-tar).
      » npm install @types/tar
    
Top answer
1 of 2
24

The tarball directory structure is like this:

$ tar tf node-v6.10.1-linux-x64.tar.xz | head
node-v6.10.1-linux-x64/
node-v6.10.1-linux-x64/bin/
node-v6.10.1-linux-x64/bin/npm
node-v6.10.1-linux-x64/bin/node
node-v6.10.1-linux-x64/share/
node-v6.10.1-linux-x64/share/man/
node-v6.10.1-linux-x64/share/man/man1/
node-v6.10.1-linux-x64/share/man/man1/node.1
node-v6.10.1-linux-x64/share/systemtap/
node-v6.10.1-linux-x64/share/systemtap/tapset/

When you extract this archive without any other options in /usr/local, you get this:

/usr/local/node-v6.10.1-linux-x64/
/usr/local/node-v6.10.1-linux-x64/bin/
/usr/local/node-v6.10.1-linux-x64/bin/npm
/usr/local/node-v6.10.1-linux-x64/bin/node
/usr/local/node-v6.10.1-linux-x64/share/
/usr/local/node-v6.10.1-linux-x64/share/man/
/usr/local/node-v6.10.1-linux-x64/share/man/man1/
/usr/local/node-v6.10.1-linux-x64/share/man/man1/node.1
/usr/local/node-v6.10.1-linux-x64/share/systemtap/
/usr/local/node-v6.10.1-linux-x64/share/systemtap/tapset/

So, a new directory is created in /usr/local, and the files get dumped there.

However, with --strip-components=1, one directory component from the extracted path is removed, so node-v6.10.1-linux-x64/bin/ becomes bin/ and node-v6.10.1-linux-x64/bin/npm becomes bin/npm:

/usr/local/
/usr/local/bin/
/usr/local/bin/npm
/usr/local/bin/node
/usr/local/share/
/usr/local/share/man/
/usr/local/share/man/man1/
/usr/local/share/man/man1/node.1
/usr/local/share/systemtap/
/usr/local/share/systemtap/tapset/

And /usr/local/bin is already in PATH, so you don't need to do anything else to execute npm and node.

2 of 2
14

This is sort of a cool (yet annoying) way of installing NodeJS.

If you run tar tf /usr/save/node-v4.2.1-linux-x64.tar.gz on the file, you'll see something like this:

node-v4.2.1-linux-x64/
node-v4.2.1-linux-x64/bin/
node-v4.2.1-linux-x64/bin/npm
node-v4.2.1-linux-x64/bin/node
node-v4.2.1-linux-x64/share/
node-v4.2.1-linux-x64/share/man/
node-v4.2.1-linux-x64/share/man/man1/

Basically, this means that when you extract this tar archive, it'll extract to a folder called node-v4.2.1-linux-x64 with all of these subfolders (and the node installation) inside of it. In fact, you can even try this extraction to get a better idea:

mkdir /tmp/node
cd /tmp/node
tar xvf /usr/save/node-v4.2.1-linux-x64.tar.gz

If you run ls, you'll see a node-v4.2.1-linux-x64 folder.

Now, --strip-components 1 does something interesting to the extraction process. From man tar:

 --strip-components=NUMBER
       strip NUMBER leading components from file names on extraction

Basically, this means that when tar is going to extract your archive, it's going to pretend like the node-v4.2.1-linux-x64 folder isn't there. Instead, it's going to extract bin/, share/ and all the other folders directly.

In fact, you can try it:

mkdir /tmp/node
cd /tmp/node
tar xvf /usr/save/node-v4.2.1-linux-x64.tar.gz --strip-components=1

If you run ls, you'll see there's no longer a node-v4.2.1-linux-x64 folder. It's just bin/, include/, lib/, and share/ (all coincidentally folders in /usr/local/).

Your second command wouldn't have worked because it would have just extracted the node-v4.2.1-linux-x64 folder to /usr/local (if it even ran at all). If you run ls /usr/local, you might even see this folder hanging around. It's useless, feel free to delete with rm. As for why it's useless, keep reading...


Now that we've explained how the tar command works, we can explain how this gets installed.

Every Linux system has something called the $PATH variable, which determines where executable files are stored. Among these places is /usr/local/bin. When you extract that binary inside /usr/local (which I'm confident is what your install instructions say), the NodeJS binary is being written to /usr/local/bin/node as per how extractions are done. Similarly, all the libraries are being added to the local library folder and everything pretty much just goes where it belongs.

Now, the caveat (and why this is annoying) is that apt won't see or understand or realize what's going on. You won't be able to update it through sudo apt upgrade or similar. You'd need to manually go in and clean the old NodeJS install and then put in the new one in case you ever want to upgrade.

I would recommend you just run sudo apt install nodejs-legacy instead. Less pain, and it automatically updates for you.

🌐
Snyk
snyk.io › snyk vulnerability database › npm
node-tar.gz - npm Package Health Analysis
An important project maintenance signal to consider for node-tar.gz is that it hasn't seen any new versions released to npm in the past 12 months, and could be considered as a discontinued project, or that which receives low attention from its maintainers.