Ask coding questions

← Back to all posts
Can I update Node.js?
RayDorepp

I want to make a new bot, but I get this error:

I searched up discord.js' discord server, and there they said I need to update node.js to v.16.6! Is it possible here and if yes, how?
I don't really get why is the error tho, I have 4 other bots and I copy-pasted the index.js file from them.

Answered by EpicGamer007 [earned 5 cycles]
View Answer
Voters
RayDorepp
Comments
hotnewtop
EpicGamer007

Copied from replit discord server

Hey everyone, You are probably aware that Discord.js v13 requires Node.js 16.6.0 and higher, but the highest on our installation of Nix is currently 16.4.1 and the highest on Nix unstable being 16.5.0. The reasoning for this isn't Replit's or Nix's fault, but partially Apple's fault and Node's fault. You see, the MacOS X SDK doesn't come with the signpost.h header, which Nix requires for a successful build of Node.js 16.6.0+ build. Additionally, the C++ compiler needed by Node 16.6.1 is too new for LLVM 10, which Node.js uses. The Nix community is pushing to have the Nix use LLVM 11 instead, so there is some progress there. In the meantime, feel free to fork this repl (linked below) and use it. It has Node.js 16.6.1 installed through NPM and should work just fine until 16.6.0+ will be available through Nix (or we build it on our own ;)) - BTW, shoutout to @moon for this tip! - le Replit team

TLDR: Apple baf, they why Node 16.6 not on Nix, use this for now: https://replit.com/@piemadd/Node-1661

EpicGamer007

Alternatively you could npm install [email protected] which is the latest version which supports the older version of node

QuickV

A million people have asked this in the past like 5 days ;-;

RayDorepp

@QuickV I thought so, I just didn't find them, so I thought it would be easier to ask it myself.

QuickV

You can use the search bar ;-; @RayDorepp

RayDorepp

@QuickV I did. And didn't find them.

QuickV

if you literally search "node js update" in the search on ask, it will bring up tons of results ;-; @RayDorepp

RayDorepp

@QuickV My question was already answered, why are you pushing this?

QuickV

oh yeah....

sorry about that ;-;

@RayDorepp

MrVoo

A hundred people already asked, use Nix