40
votes

I work with laravel 5 , when i type in windows cmd this command "touch storage\database.sqlite" this error message rise 'touch' is not recognized as an internal or external command, operable program or batch file. any hint to solve it ?

14
Why do you think you need to run it?CL.
touch is a *nix command, not a Windows one. Here are some solutions: superuser.com/questions/10426/…Joel Hinz
@JoelHinz unix*FindOutIslamNow
@FindOutIslamNow No, I meant *nix. Please have a look e.g. here stackoverflow.com/questions/4715374/…Joel Hinz
To create a file in windows cmd you can use type nul>example.txtAMD

14 Answers

125
votes

if you are using node.js just use npm to install it on Windows:

C:\npm install touch-cli -g

it will install the command line interface for touch, you can then use it the same as unix...

15
votes

Fixed after running this command:

npm install touch-cli -g

After that I can run this:

touch .babelrc
7
votes

The command you're trying to run is a unix/linux based command so it won't work in Windows.

All it does is update the modified timestamps of a file.

There's another question on here that gives you an alternative for Windows: https://superuser.com/questions/10426/windows-equivalent-of-the-linux-command-touch/764716

4
votes

You can just use echo> in windows cmd i.epath/file.sqlite

4
votes

If you are on windows device just install git bash and type the following command

touch test.html.

The above command will generate a zero kilobyte test.html file for you in your specified directory. It is applicable to any other type of file.

4
votes

You have to install Touch CLI, Run below command in CLI

npm install touch-cli -g
3
votes

If you are trying to use TypeScript in ReactNative first run:

npm install touch-cli -g

and then you can use touch, example:

touch rn-cli.config.js
2
votes

enter image description here

ex: type nul >test.html in windows CMD & another one ways is

echo.>test.html

both are working 100% fine

0
votes

, used with copy to indicate missing parameters. This updates the files modified date. E.G. copy /b file1,,

0
votes

Just run it through the GitBash terminal on windows and it works fine

0
votes

I use this syntax in cmd. So far it is working well without installing something.

type nul > (filename)

In my case, I used

type nul > index.js // for creating an empty Javascript file.

0
votes

If all the solutions above still dont work for you. Try this:

If you already have Git installed, then you also have GIT BASH installed too... To solve this problem navigate to your project directory using the GIT BASH Terminal and try again using touch Procfile. It should work perfectly.

0
votes

While Setup with Larvel mix in ExpressJs on windows touch webpack.mix.js touch is not recognized . Above methos helped me

type nul > (filename)
0
votes

Incase anyone is trying to use the 'touch' command from windows to configure Typescript for a React Native app, or anything else. It works for me by running the 'touch' command either from git bash or by downloading the WSL and running it from there.