Home > Blockchain >  How to add Nodejs enviroment path in Ubuntu?
How to add Nodejs enviroment path in Ubuntu?

Time:01-04

I have installed node and npm on my Ubuntu 22.10 It is working fine in the terminal.terminal screenshot

But It is not working in VS Code VS Code Screenshot

I think i need to add set up environment varibles. Please help me out.. (Starship prompt is also not wot working on VS Code but it is working fine on ubuntu terminal) for reference

I tried adding environment varibles but I think i messed up. I reffered to this article. https://askubuntu.com/questions/881691/node-bash-path-confusion-on-ubuntu-16-using-n

CodePudding user response:

First find out where npm and node are located using the commands:

which npm
which node

Then add npm and node to the environment variable using the VS Code terminal using the commands:

export PATH=$PATH:/example/npm
export PATH=$PATH:/example/node

CodePudding user response:

Are you sure you are using the same shell?

If not, then print out the PATH variable in the terminal with echo $PATH and set the output in the VS Code terminal to test (by export $PATH=<output>)

  • Related