DEV Community

angelyoutz
angelyoutz

Posted on

‘touch’ is not recognized as an internal or external command, operable program or batch file

Consider that, You are using node.js just use npm with a view to install it on windows.

node.js npm:

C:\ npm install touch-cli-g

For doing this, it will install the command line interface for touch. So, you can use it the same as Unix.

Another way you can do this. Using

echo>

in windows cmd

path / file. Sqlite

This command is a unix/linux based command. Therefore, it doesn’t perform in windows. But it does update the modified timestamps of a file. If you are using with copy to imply missing parameters. Then this will updates the files modified date.

Example Given:

Copy / b file1 ,,

Command prompt: c:\windows\system32\cmd.exe

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved
C:\users\sekar>cd desktop
C: \users\sekar\Desktop>cd react-test
C: \users\sekar\Desktop\react-test > type nul>webpack.config.js
C: \users\sekar\Desktop\react-test>
Enter fullscreen mode Exit fullscreen mode

Example:

Type nul>test.html in windows CMD and another one method is

echo.>test.html

Both will be working. In case you are on windows device just install git bash. Then type the following command

touch test.html

After running this command it will generate a 0 Kilobyte test.html file for you in your specified directory. It is contextual to any other type of file. Read more

Top comments (1)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

git-bash is not OK?

Otherwise, better yet, WSL.