Create file with command line in Node

我的梦境 提交于 2019-12-03 09:55:49

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

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.

You can use : copy nul > Gulpfile.js

You can also use the following command:

copy con [filename.extension]

[Note: Don't include square brackets]

That's it!

Follow the link For installation in Windows https://www.npmjs.com/package/touch-for-windows Installation In command prompt type: npm install -g touch-for-windows.

Usage After installing, you can run this application via the command line, as shown below.

C:\pythonapp>touch index.html Successfully created 'index.html'

Worked for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!