Created a app.js
file with the following content:
var msg = 'Hello World';
console.log(msg);
Run the file using node
on the command line, and the error will be as follows:
Usedvs code
, the debugging interface outputs normally.
I have been using webstorm
before, and it seems that there will be no such problem.
Is this what you said?
This error is that there is no app.js file in your app directory
When opening the command line tool, do not enter the node environment, switch directly to the directory and enter node app.js. Don’t enter node first