You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4.) Create a simple .js file -> MyFirstJS.js -> console.log("Hai");
5.) node MyFirstJS.js will run the script
6.) To enter into node cmd,
open cmd
type node
type any js command. Eg: console.log("hello");
// will print
hello
undefined<in grey color>
7.) In Windows, Node JS cmd comes with installation. But sometimes shows error
800A1391 'console' is undefined
etc. This is beacause, Windows try to run .js files/ scripts with Microsoft Scripting Engine by default whereas we need to run it via Chrome v8 engine.
When does node <filename>.js, it enables to run program in v8 engine.