Wrong Node Version

Hey, I'm trying to install packages but it says discord.js only supports v16, but when I run node -v it says I have V16.
21 Replies
d.js docs
d.js docs2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Jaworek
Jaworek2y ago
update to 16.6+
Almeida
Almeida2y ago
probably a bug with the yarn version you're using have you tried creating another terminal session?
Chelsea
Chelsea2y ago
nope, ill try didnt work didnt work any other ideas
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Chelsea
Chelsea2y ago
16.6 using replit so not really an option
Stealth
Stealth2y ago
Check your package.json under engines
Chelsea
Chelsea2y ago
"devDependencies": {
"node": "16.6"
}
"devDependencies": {
"node": "16.6"
}
Stealth
Stealth2y ago
what that's your devDependency not your engine
Chelsea
Chelsea2y ago
just added this:
"engines": {
"node": "16.6.0"
},
"engines": {
"node": "16.6.0"
},
still error
Stealth
Stealth2y ago
Hmmm... remove engines part and make sure to remove any dependencies that has "node" like the one you showed above
Chelsea
Chelsea2y ago
done same error
Stealth
Stealth2y ago
How did u install yarn? and what OS are u using
Chelsea
Chelsea2y ago
replit
Stealth
Stealth2y ago
Does it work locally?
Chelsea
Chelsea2y ago
havent tested gimme a sec b4 i test locally, i think ik what the issue is i used this to update to v16 because replit doesnt come with it already when u make a repl
npm init -y && npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH
npm init -y && npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH
is the issue in this? @mateie
Stealth
Stealth2y ago
yes you're not updating your node to 16 from that line
Chelsea
Chelsea2y ago
i see is there a line of code that u can use to update it?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Stealth
Stealth2y ago
ArtA might be right here try what they suggest