Visual Studio Code NPM and Node.js issues

Damsp94 Posted messages 183 Registration date   Status Membre Last intervention   -  
jordane45 Posted messages 30426 Registration date   Status Modérateur Last intervention   -
Hello,

I rarely come here because I usually manage to handle things, but now it's impossible, I'm asking for help or else I'm going to smash my head on the PC.

Let me explain.
I want to create a Discord bot in JS after already having created one in Python.
I wanted to learn JS because, well, Java is everywhere.

So, I installed Visual Studio Code, installed Node.js
I added the paths in Path in the environment variables,

And when I type "node -v" or "npm" in the integrated terminal of VSC, I get this error:

npm: The term 'npm' is not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a
path exists, check that the path is correct and try again.
At line:1 char:1
+ npm
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Yet these commands work if I type them in the classic cmd.
It's just the VSC terminal that gives me this error.
I also tried with version 17 of Node, it doesn't change anything.
I restarted the PC well between each attempt to fix the problem.
I’m totally lost.

Thanks in advance for your help.

Best regards, Damien

Configuration: Windows / Edge 97.0.1072.69

1 réponse

jordane45 Posted messages 30426 Registration date   Status Modérateur Last intervention   4 830
 
Hello,

It seems that you need to set the default shell of vscode to cmd

Come to VS Code and set the default shell to cmd. To do so, - Press Ctrl+Shift+P and type Select Default Shell - Select Command Prompt


PS: You said:
I wanted to learn JS because, well, Java is everywhere.

Except that ... JS .. is JS .. and JAVA ... is JAVA .. They are two completely different languages...

--
.
Best regards,
Jordane
-4