[SOLVED] How To Set Node.js Extension PATH in VS Code
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to let VSCode to know where node is and so far I can't find where to set the PATH.
If you had chosen to answer the question, then you would know what to set the PATH to. You might want to think about that.
So, again: what does "which node" print out? Entering "which node" would actually tell you where the node binary is. The output of "npm version" does not.
Quote:
Originally Posted by NevemTeve
It might have a point: please quote the output of command /usr/bin/node --version
Quote:
Originally Posted by lattimro
Right now I reinstalled 17.9.0 from 19.3.0 (and 18.13.0). So the output is 17.9.0
Did you actually do it, or did you just assume the output would be 17.9.0 and not, say, "no such file or directory"?
Distribution: SOLARIS-BSD-like, almost Linux-like, some Arch-like, some GENTO-like, some RH-like, some slacky-like
Posts: 307
Original Poster
Rep:
Quote:
Originally Posted by dugan
If you had chosen to answer the question, then you would know what to set the PATH to. You might want to think about that.
So, again: what does "which node" print out? Entering "which node" would actually tell you where the node binary is. The output of "npm version" does not.
Did you actually do it, or did you just assume the output would be 17.9.0 and not, say, "no such file or directory"?
Really? I am wondering what do you think about #1 where I exported the PATH to /usr/bin/node. Why you think I did that? Do I need to know where the node is when I know where is it? Maybe I exported because I KNOW where node is. I tested a *.js file and works fine on machine. The issue is that is not been seen by VSCode.
The node is not found on VSCode and this is the issue this answer was raised.
I thought #16 means you couldn't run command `/usr/bin/node --version` because installing an older version took all your time.
Or it means installing an older version solved your problem.
Distribution: SOLARIS-BSD-like, almost Linux-like, some Arch-like, some GENTO-like, some RH-like, some slacky-like
Posts: 307
Original Poster
Rep:
Quote:
Originally Posted by NevemTeve
It might have a point: please quote the output of command /usr/bin/node --version
Note this is for VSCode terminal:
Code:
sh-5.1$ /usr/bin/node -v
sh: /usr/bin/node: No such file or directory
sh-5.1$ whereis node
node:
sh-5.1$ which node
which: no node in (/app/bin:/app/bin:/app/bin:/usr/bin:/home/brad/.var/app/com.visualstudio.code/data/node_modules/bin)
sh-5.1$
so I am saying again VSCode is not seeing node installed on the machine
Distribution: SOLARIS-BSD-like, almost Linux-like, some Arch-like, some GENTO-like, some RH-like, some slacky-like
Posts: 307
Original Poster
Rep:
Quote:
Originally Posted by dugan
Yes, really.
I already told you what I think about that. I told you in my first post in the thread.
Unless your path to your node executable is /usr/bin/node/node, then that is wrong.
Now, when you go into VSCode's terminal (from its "Terminal" menu) and enter "echo $PATH", what do you get? Or are you going to refuse to do that too?
I am not refusing anything, I appreciate your help just sometimes I can't wake-up the remote machine, poor signal.
Code:
sh-5.1$ mc
sh: mc: command not found
sh-5.1$ echo $PATH
/app/bin:/app/bin:/app/bin:/usr/bin:/home/brad/.var/app/com.visualstudio.code/data/node_modules/bin
sh-5.1$
OK I see, I will remove flatpack's installation and I will give a try and reinstall from sources. But as far as I recall I had the same issue, I may be wrong ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.