#Nodejs installation problem
83 messages · Page 1 of 1 (latest)
You don't have node js or the nvm things are not in ~/.bashrc PATH
If you don't have node js install this
installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
download and install Node.js (you may need to restart the terminal)
nvm install 20
Or if you arleady install node js type this in ~/.bashrc file and then source ~/.bashrc
nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion
I'm sorry, I have nodejs installed already and I just wrote "nvm install 20" in linux Terminal. How do I "type this in ~/.bashrc file and then source ~/.bashrc"? I dont get it.
type source ~/.bashrc
Nothing happened, brother.
if you install with nvm it should be added automatically in ~/.bashrc
open the bashrc code ~/.bashrc
paste in here i wanna see
Screenshots you mean?
Hmmm weird stuff, wait.
I can send more screenshots if you need.
type node --version
type node 01.1.js
the file 01.1.js
Yes, but my problem is in the output, there I have a problem
First screenshot from the post is the output, not the terminal.
wait
its okay
i use code runner extension, perfectly fine.
[Running] node "/home/fauzan/lol/01.js"
Hello world
[Done] exited with code=0 in 0.054 seconds
Yeah I have it too
I think the problem is in the $PATH of node but don't know what...
try adding this
export PATH="/home/mirko/.nvm/versions/node/v20.12.2/bin:$PATH"
below the nvm
type in ~/.bashrc file
oh sorry
like that?
yap
Well, ctrl+alt+n still gives the same error message
change the 20.12.2 to 20.14.0 and then source ~/.bashrc
In your machine node works perfectly fine but in vscode weird stuff happen
Remove the EXPORT path from bashrc
no difference
the whole line?
Yap here
export PATH="/home/mirko/.nvm/versions/node/v20.12.2/bin:$PATH"
okay, I did
And then restart
restart PC or VSCode?
-_- weird stuff, i mean if you type node 01.1.js you can, but if you run it with vscode it's error.
Will it be better if I install VSCode from official site? What do you think, brother?
Yeah you can try this
- Reinstall node
- Reinstall vscode
And then sudo apt update && apt upgrade
How to uninstall node? Whats the command?
Where did you install node?
from the terminal
I mean nvm or apt or homebrew
nvm deactivate
nvm uninstall 20.14.0
oh thank you that worked
https://code.visualstudio.com/
install the .deb version
After I uninstalled nvm and node I still see the version if i type nvm -v or node -v, is this normal?
yeah normal
Nvm is node.js version manager in short, is like rbenv from ruby land
I mean weird stuff happen again, why you have 2 node version -_-, but the nvm thing is normal.
Thank you so much, brother!
Oh my god
Any idea how I can get Java running on VSCode? Haven't done any research on my own yet.
I never install java in my system
maybe you surfing on the internet or ask in java land
i mean java forum stuff like that
Okay, brother, god bless you!
Yeah good luck on your journey 🙂