LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How To Set Node.js Extension PATH in VS Code (https://www.linuxquestions.org/questions/programming-9/how-to-set-node-js-extension-path-in-vs-code-4175720509/)

lattimro 01-06-2023 04:49 AM

Quote:

Originally Posted by NevemTeve (Post 6402517)
It might have a point: please quote the output of command /usr/bin/node --version

Right now I reinstalled 17.9.0 from 19.3.0 (and 18.13.0). So the output is 17.9.0

dugan 01-06-2023 08:34 PM

Quote:

Originally Posted by dugan (Post 6402250)
No, I’ll just be more direct.

What does “which node” print out?

Quote:

Originally Posted by lattimro (Post 6402264)
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 (Post 6402517)
It might have a point: please quote the output of command /usr/bin/node --version

Quote:

Originally Posted by lattimro (Post 6402552)
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"?

lattimro 01-06-2023 09:36 PM

Quote:

Originally Posted by dugan (Post 6402709)
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.

NevemTeve 01-06-2023 10:03 PM

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.

Anyways, PATH should contain only directories, not individual files.
https://en.wikipedia.org/wiki/PATH_(variable)

dugan 01-06-2023 10:09 PM

Quote:

Originally Posted by lattimro (Post 6402716)
Really? I am wondering what do you think about #1 where I exported the PATH to /usr/bin/node.

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?

dugan 01-06-2023 10:14 PM

Quote:

Originally Posted by lattimro (Post 6402204)
FlatPack

Hold on a minute.

Think you might be having issues with FlatPak's sandboxing?

lattimro 01-06-2023 11:44 PM

Quote:

Originally Posted by dugan (Post 6402722)
Hold on a minute.

Think you might be having issues with FlatPak's sandboxing?

That could be a good start finally, but how to investigate that?

lattimro 01-06-2023 11:48 PM

Quote:

Originally Posted by NevemTeve (Post 6402517)
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

lattimro 01-06-2023 11:57 PM

Quote:

Originally Posted by dugan (Post 6402720)
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$


dugan 01-07-2023 12:44 AM

Quote:

Originally Posted by lattimro (Post 6402729)
That could be a good start finally, but how to investigate that?

My VSCode installation isn't FlatPak, so I won't be testing these myself. Here are two links I found:

https://stackoverflow.com/questions/...ystem-binaries

https://www.reddit.com/r/flatpak/com...srbin_etc_and/

NevemTeve 01-07-2023 01:01 AM

You should forget this flatpack-thingie, install the software properly from rpm package (or similar).

lattimro 01-07-2023 01:06 AM

Quote:

Originally Posted by dugan (Post 6402734)
My VSCode installation isn't FlatPak, so I won't be testing these myself. Here are two links I found:

https://stackoverflow.com/questions/...ystem-binaries

https://www.reddit.com/r/flatpak/com...srbin_etc_and/

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 ...

NevemTeve 01-07-2023 01:09 AM

Installing from source isn't recommended for beginners either.

dugan 01-07-2023 01:15 AM

Yeah, I think I would give up on VSCode in a FlatPak after reading these two:

https://www.reddit.com/r/flatpak/com...e_flatpak_see/

https://community.clearlinux.org/t/d...er-issues/1416

lattimro 01-07-2023 10:52 AM

Quote:

Originally Posted by NevemTeve (Post 6402740)
Installing from source isn't recommended for beginners either.

right, unfortunately I did not have luck on this post of knowledgeable members.


VSCode works fine from SlackBuild


All times are GMT -5. The time now is 08:12 AM.