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.
阿神2017-06-05 11:15:18
Is this what you said?
This error is that there is no app.js file in your app directory
天蓬老师2017-06-05 11:15:18
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