A
A
Andrej Sharapov2018-10-16 09:11:14
gulp.js
Andrej Sharapov, 2018-10-16 09:11:14

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

2 answer(s)
A
Andrej Sharapov, 2018-10-29
@Madeas

It is enough to write the pathnode ./**/lesson.js

R
Roman Dubinin, 2018-10-16
@romash

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 question

Ask a Question

731 491 924 answers to any question