Skip to content
Sign upLog in
← Back to Community

How to get V.16 in replit

Profile icon
4515384697

Node.js 16 on replit

Steps:

  1. Execute this script on the shell to install node (you can choose the version by editing the number 16) and configure npm.
npm init -y && npm i --save-dev [email protected] && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH

Or if this does not work try:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash && export NVM_DIR=\"$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\" && [ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" && nvm install 16 && nvm use 16
  1. Create the .replit to execute node from the shell instead of the console.
run = "npm start"
  1. Make sure to add the start script in your package.json file
"scripts": { "start": "node ." }
  1. (Optional) If you had packages like discord.js or sqlite before, you need to re-install those packages
npm uninstall discord.js && npm i discord.js
Voters
Profile icon
HectorBernabe
Profile icon
RedstoneRadiant
Profile icon
ZeuSEditsS
Profile icon
Thinkright20man
Profile icon
ryosukeh0817
Profile icon
DynamicSquid
Profile icon
diefrzzl
Profile icon
365DaysOfCode
Profile icon
junisguni
Profile icon
itsHIPEOPLE
Comments
hotnewtop
Profile icon
DynamicSquid

Cool!