Home > Mobile >  Getting error while install package in node.js
Getting error while install package in node.js

Time:03-21

I'm trying to install some packages like discord.js, but it gives me this error. How can I fix it?

WARN engine [email protected]: wanted: {"node":">=16.6.0","npm":">=7.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine [email protected]: wanted: {"node":">=16.6.0","npm":">=7.0.0"} (current: {"node":"4.loadDep:ws → resolveWithN ▌ ╢████░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">=12"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine [email protected]: wanted: {"node":">= 6"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine [email protected]: wanted: {"node":">=10.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine @sapphire/[email protected]: wanted: {"node":">=v14.0.0","npm":">=7.0.0"} (current: loadDep:ws → 304          ▐ ╢████░░░░░░░░░░░░░╟
WARN engine @discordjs/[email protected]: wanted: {"node":">=16.0.0","npm":">=7.0.0"} (current: {loadDep:ws → network      ▌ ╢████░░░░░░░░░░░░░╟
WARN engine @discordjs/[email protected]: wanted: {"node":">=16.0.0","npm":">=7.0.0"} (current: {"loadDep:zod → request     ▌ ╢████░░░░░░░░░░░░░╟
WARN engine @sindresorhus/[email protected]: wanted: {"node":">=10"} (current: {"node":"4.2.6","npm":"3.5loadDep:form-data → resol ▐ ╢████░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">=/home/ssthunder
├─┬ [email protected]
│ ├── UNMET PEER DEPENDENCY bufferutil@^4.0.1
│ ├── UNMET PEER DEPENDENCY encoding@^0.1.0
│ └── UNMET PEER DEPENDENCY utf-8-validate@^5.0.2
└─┬ [email protected]
  ├── UNMET PEER DEPENDENCY bufferutil@^4.0.1
  └── UNMET PEER DEPENDENCY utf-8-validate@^5.0.2

npm WARN enoent ENOENT: no such file or directory, open '/home/ssthunder/package.json'
npm WARN [email protected] requires a peer of encoding@^0.1.0 but none was installed.
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN ssthunder No description
npm WARN ssthunder No repository field.
npm WARN ssthunder No README data
npm WARN ssthunder No license field.

CodePudding user response:

In your error, it says that Discord.js requires Node.js at v16.6.0, and npm at v7.0.0 (as it says below, extracted from your error).

WARN engine [email protected]: wanted: {"node":">=16.6.0","npm":">=7.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})

The current versions you have are extremely low, so I recommend updating Node.js every month.

To update Node.js, download the installer from nodejs.org. When you run the installer, it will automatically delete the old version.

Once you've updated Node.js and npm to their required versions (or higher), then you can run the install command, and it should install then.

CodePudding user response:

Your node & npm versions are older. Update them and make sure your local account name doesn't have non-ASCII characters.

  • Related