Answer the question
In order to leave comments, you need to log in
How to run a script in VSC?
Wrote a script with a value output to the console console.log(); But I don't know how to check. I also tried using "scripts" in package.json, but since I'm new to this and it didn't work either.
Guys, tell me:
1. how to set up "scripts": { "script": "./**/*/lesson.js" } and commands (so far I only know clear , to clear the terminal) to test the script
. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
To run a script in a terminal, you need an interpreter. For js, this is NodeJS .
After installation, you will need to restart VSC for it to see it. To make sure the interpreter is installed and available, type in the terminal
this command will display the installed version of NodeJS.
To run the lesson.js script, it is enough to write in the terminal
or even
Truth, given that you have VSC, it may be more convenient to use it than the terminal (NodeJS still needs to be installed):
To begin with, you must have a project folder, and not just file opened in VSC (create a folder, put your scripts that you want to run there in VSC File -> Open Folder and select the created folder).
On the left panel there is a button with the image of a bug that opens the debug panel. In this panel at the top you will have "No configuration" written. You need to click on the gear next to it, if a choice appears, select Node. A debug configuration file will be created, after which you can safely open your scripts, set breakpoints, click the green arrow in the debug panel and rejoice.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question