'npm throw errors when installing dependencies of hardhat

when installing those dependencies:

npm install ethers hardhat @nomiclabs/hardhat-waffle ethereum-waffle
chai @nomiclabs/hardhat-ethers

Those errors occurred:

npm WARN deprecated [email protected]: ganache-core is now ganache; visit https://trfl.io/g7 for details
npm WARN deprecated [email protected]: ganache-core is now ganache; visit https://trfl.io/g7 for details
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: testrpc has been renamed to ganache-cli, please use this package from now on.
npm WARN deprecated @ensdomains/[email protected]: Please use @ensdomains/ens-contracts
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rimxjoudi/.npm/_logs/2022-02-24T12_02_36_700Z-debug-0.log

How can I get rid of those errors, any help please!



Solution 1:[1]

You can refer this article : https://dev.to/devtonight/how-to-fix-npm-timeout-errors-on-slow-internet-connections-2kn4

or try this

npm set timeout=100000

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 anks_patel