Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

tvhsin/node.js-v16-replit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Note: Use the new NodeJS 16 template instead of this please. That one is far easier to use and makes it simple to upgrade it the future as it uses nix. (Recommended by replit staff)

Node.js 16/14 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 node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH

Or if this does not work try the one below for node.js v14:

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

About

improved from RLX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published