How Can I Update Node.JS Versıon?
I'm using Repl.it for hosting my Discord bot but Discord API Wrapper requires Node.js v12 version. But my project's Node.js version is v10. I don't know how can i update Node.js please help me.
As I've said on https://repl.it/talk/ask/change-node-version/5924:
Actually, you can change the node version. Here I'm going to use nvm. My bash script for installing it and setting it up is right here:
This will install the lts version, but you can change that to be a different version (using
nvm install 14.15.4 if you want 14.15.4, and then running
nvm use 14.15.4 to use the 14.15.4 version). By the way, this is assuming the code is contained in use_nvm.sh (so the echo at the end is correct). To run the code (again assuming it is stored in use_nvm.sh), just run
bash use_nvm.sh in shell.
Note: You must run this every time you reopen the repo.
@CrazyVideoGamez thanks, but where do i run bash file.sh? I have a node.js script. Should I run in the console or in index.js? I tried both the places, but i get an error message saying file is undefined identifier :( I want to host a minecraft bot for keeping my aternos server online but it requires node version 14.x.x+