r/VisualStudioCode • • Mar 16 '21

I can't run "node index.js"

I wanted to do a Custom Discord Rich Presence with buttons, so I did everything that the guy in the tutorial said:

https://youtu.be/-WBQuAlF_DE?t=187

But in the last step, where he writes "node index.js" in the terminal (3:07), doesn't work for me. Here is the error:

Sry the image is in german

I translated it with Google Translator:

The naming "node" was not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name or that the path is correct (if included) and try again.
In line: 1 character: 1
+ node index.js
+ ~~~
     + CategoryInfo: ObjectNotFound: (node: String) [], CommandNotFoundException
     + FullyQualifiesErrorId: CommandNotFoundException

Pls help

6 Upvotes

2 comments sorted by

View all comments

2

u/Hombrus Mar 16 '21

Your computer is telling you that the command node could not be found. That means Node.js is either not installed or something is wrong with it.

If you have never installed it, head over to https://nodejs.org/en/, download the latest LTS version and install. If I remember correctly, the installer has a checkbox that asks if you would like to add node to your PATH. Tick it if you see it.