I am encountering an issue when running npm install on my Ubuntu server. It works fine on my local environment (Windows/macOS), but on the server, the installation fails with the following error:
lua
Copy code
npm ERR! TAR_BAD_ARCHIVE: Unrecognized archive format
This error occurs during the package installation process. The error log shows the issue happens when trying to extract certain packages.
Environment Details:
Local Environment:
OS: Windows 11
Node.js version: 18.20.5
npm version: 10.2.3
Server Environment:
OS: Ubuntu 22.04 LTS
Node.js version: 18.20
pm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-12-17T11_59_28 _172Z-debug-0.log
root@zotac31870:~/zota-cpos-backend-ts# npm i
npm WARN tar TAR_BAD_ARCHIVE: Unrecognized archive format
npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do no t use it. Check out lru-cache if you want a good and tested way to coalesce async request s by a key value, which is much more comprehensive and powerful.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions m ay use Math.random() in certain circumstances, which is known to be problematic. See htt ps://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/r equest/request/issues/3142
2
Answers
npm config set registry https://registry.npmmirror.com/ --global
run this command, it seems like the issue with npm registeryeven happened me for last two days