Create file with command line in Node

You can use the following command:

echo> index.js

touch is generally present on *nix platforms but not Windows. You will be able to follow the tutorial without it.

The tutorial author is using it to create empty files. You could achieve the same by simply saving files with the same names using an editor.

Alternatively, if you really want to use it in Windows, try Cygwin.


That command is for a unix environment. You can use the following to create an empty file with similar functionalities that touch has in windows:

echo $null >> server.js in the desired directory