'I got many warning and error when installing truffle

I run the code 'npm install -g truffle' also tried 'npm install truffle', but the result is the same, here is the warning and error I got. When I try to install truffle, this show to me. I don't know how to fix it.

Example:

npm WARN deprecated [email protected]: testrpc has been renamed to ganache-cli, please use this package from now on.
npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.


Solution 1:[1]

They're working on transferring webpack init boilerplate over to Box structure which caused the depreciated errors, simply update your node to v16 or v17 LTS and run the following to install:

npx truffle unbox webpack

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 ALLI RAHEEM