Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Updating Node.js to 16+ in Replit
Arnav Kumar
Arnav Kumar

Posted on • Edited on

     

Updating Node.js to 16+ in Replit

Hey There,
Welcome to my first post, today i'll tell you how can you update yourReplit'sNodejs version to 16+, so lets get started.

Many want to do that as to supportDiscord's latest v13 as it would only run onNodejs v16.6 or higher. But there maybe your own reasons (Nobody likes old versions 😅).

Here's our repl at version 12.x.x after this tutorial it will be updated to 16+
Unupdated Repl

At first go to yourrepl or if you don't have any just create one.

Go to theshell prompt and run the following code

npm init-y&& npm i--save-dev node@16&& npm configsetprefix=$(pwd)/node_modules/node&&exportPATH=$(pwd)/node_modules/node/bin:$PATH
Enter fullscreen modeExit fullscreen mode

Shell with code

After running the code you would see the following output:

Shell after Run

And congo 🎉 your repl's nodejs has been successfully updated to 16+.
You could further confirm it by runningnode -v in the shell

Success

Update: There's another better way to do this now just use the Node 16 template while creating the repl
https://replit.com/@RoBlockHead/NodeJS-16

Top comments(11)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
vonheikemen profile image
Heiker
Web developer from Venezuela. I like solving problems. Currently trying to improve my communication skills
  • Pronouns
    he/him
  • Joined

Nice post.

I always forgetnode is an npm package.

One could also use the.replit file to reference thenode version insidenode_modules.

run="node_modules/.bin/node index.js"
Enter fullscreen modeExit fullscreen mode
CollapseExpand
 
kingisawesome profile image
kingisawesome
  • Joined

Hi! Nice post and nice solution. My problem is every time I close my replit and open it again, the node version goes back to 12+ and I have to manually update it to 16+ again. Is there a solution to permanently upgrade node.js to +16 in my own repl?

CollapseExpand
 
arnavkr profile image
Arnav Kumar
A Full-Stack Web Developer, UI/UX designer, Cryptography, Cybersecurity Lover
  • Location
    India
  • Pronouns
    he/him
  • Work
    Web Developer
  • Joined

How do you check your version

Do you see in console panel or the shell one

The console will always show 12 even if its originally 16

The more reliable way to check isnode -v

CollapseExpand
 
kingisawesome profile image
kingisawesome
  • Joined
• Edited on• Edited

I use the shell, and yes I use node -v and it shows version 12 after I update to 16 whenever the repl.it closes so I manually do the command everytime

Thread Thread
 
arnavkr profile image
Arnav Kumar
A Full-Stack Web Developer, UI/UX designer, Cryptography, Cybersecurity Lover
  • Location
    India
  • Pronouns
    he/him
  • Work
    Web Developer
  • Joined

Ig replit has changed in a while.
When i was writing the post i myself tried reopening the repl to see whether it still there or not and it was there but it doesn't happen.

A hackey solution to this would be installing node everytime you run the repl 😅

Ik it sounds strange but it may work maybe

You can try putting that code in replit run script

CollapseExpand
 
arnavkr profile image
Arnav Kumar
A Full-Stack Web Developer, UI/UX designer, Cryptography, Cybersecurity Lover
  • Location
    India
  • Pronouns
    he/him
  • Work
    Web Developer
  • Joined

Hey there i have updated the post

Now u can use the Node 16 template while creating a repl in replit

Here's the template
replit.com/@RoBlockHead/NodeJS-16

CollapseExpand
 
rajnishanand profile image
Rajnish Anand
Do Something Today that your Future Self will Thank you For.
  • Location
    India
  • Joined

Nicely Explained ✨

CollapseExpand
 
arnavkr profile image
Arnav Kumar
A Full-Stack Web Developer, UI/UX designer, Cryptography, Cybersecurity Lover
  • Location
    India
  • Pronouns
    he/him
  • Work
    Web Developer
  • Joined

Thanks 😃

CollapseExpand
 
anurag90tech profile image
Anurag Saikia
Hey! I'm Anurag Saikia, a beginner web-developer.

Awesome code Bro... Love from Sololearn ❣️

CollapseExpand
 
arnavkr profile image
Arnav Kumar
A Full-Stack Web Developer, UI/UX designer, Cryptography, Cybersecurity Lover
  • Location
    India
  • Pronouns
    he/him
  • Work
    Web Developer
  • Joined

ThankU 😀

CollapseExpand
 
insidiousthedev profile image
Insidious
Just another geeky introverted teenager.
  • Location
    India
  • Work
    Student
  • Joined

Glad I found this!

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

A Full-Stack Web Developer, UI/UX designer, Cryptography, Cybersecurity Lover
  • Location
    India
  • Pronouns
    he/him
  • Work
    Web Developer
  • Joined

More fromArnav Kumar

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp