How to Install NodeJS onto VS Code Server?

So I just created a fresh CodeServer using Linode and wanted to create a program that needs NodeJS. But Im not sure how to do that since CodeServer is on the cloud and Im using Linode. I already have NodeJS on my mac so I find it wierd its not working. Whenever I type something like "npm instaill -y" on the VS Codeserver's terminal I get "root@[ip]:/root# npm init -y bash: npm: command not found"
13 Replies
Phorcys
Phorcys3y ago
are you running code-server standalone with no docker or anything like that? if yes, you can just install nodejs onto the server I recommend http://nvm.sh (ubuntu/debian's node pkgs are LTS)
XRPisDadddy
XRPisDadddy3y ago
This is really difficult
XRPisDadddy
XRPisDadddy3y ago
This is my linode serevr
No description
XRPisDadddy
XRPisDadddy3y ago
Without leaking too much info I dont have a docker all the linode server has is the codeserver link Is there a YouTube video I could watch that can guide be more easily?
Phorcys
Phorcys3y ago
just run the following on the Linode server:
# Installs NVM
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

# renders NVM accessible from the current she
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"

# installs latest node version
nvm install node
nvm use node
# Installs NVM
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

# renders NVM accessible from the current she
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"

# installs latest node version
nvm install node
nvm use node
basically, you don't install node on code-server, you install node on the machine that hosts code-server
XRPisDadddy
XRPisDadddy3y ago
Where is the Linode server to type the script in?
Phorcys
Phorcys3y ago
sorry? just open a terminal via ssh and run those commands or even run them from your vscode terminal
XRPisDadddy
XRPisDadddy3y ago
Im not sure how to do that Im really new to Linode, sorry for the late reply I was busy Is there a YouTube video or article that can guide me ok wait I ran the script onto vscode sevrer and it says
=> Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
OR
=> Append the following lines to the correct file yourself:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

=> Close and reopen your terminal to start using nvm or run the following to use it now:
=> Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
OR
=> Append the following lines to the correct file yourself:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

=> Close and reopen your terminal to start using nvm or run the following to use it now:
XRPisDadddy
XRPisDadddy3y ago
No description
XRPisDadddy
XRPisDadddy3y ago
This is what it gave me after I typed "wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash"
This is what it gave me after I typed "wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash"
Phorcys
Phorcys3y ago
do what it says do nano ~/.bashrc and put the following text in it:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
btw you use CTRL+X to close nano
XRPisDadddy
XRPisDadddy3y ago
Awesome it works Thank you You may close, thank you @Phorcys
Phorcys
Phorcys3y ago
alright you can use /resolve for future issues i'm doing it for this one
Want results from more Discord servers?
Add your server