windows 'touch' 不是内部或外部命令,也不是可运行的程序或批处理文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36126269/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:30:49  来源:igfitidea点击:

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

windowscmdcommand-line-interface

提问by HussamDev

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 ?

我使用 laravel 5,当我在 windows cmd 中输入此命令“touch storage\database.sqlite”时,此错误消息出现“touch”未被识别为内部或外部命令、可运行的程序或批处理文件。任何提示来解决它?

回答by cyberdenz

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

如果您使用的是 node.js,只需使用 npm 在 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...

它将安装用于触摸的命令行界面,然后您可以像使用 unix 一样使用它...

回答by ollieread

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

您尝试运行的命令是基于 unix/linux 的命令,因此它在 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

这里还有另一个问题可以为您提供 Windows 的替代方案:https: //superuser.com/questions/10426/windows-equivalent-of-the-linux-command-touch/764716

回答by Colleen Larsen

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

你可以只echo>在 windows cmd 中使用,即path/file.sqlite

回答by Emmanuel David

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

如果您使用的是 Windows 设备,只需安装 git bash 并键入以下命令

touch test.html.

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

上面的命令将test.html在您指定的目录中为您生成一个 0 KB 的文件。它适用于任何其他类型的文件。

回答by Muhammad Awais

Fixed after running this command:

运行此命令后修复:

npm install touch-cli -g

After that I can run this:

之后我可以运行这个:

touch .babelrc

回答by seka

enter image description here

在此处输入图片说明

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

例如: 在 Windows CMD 中键入 nul >test.html和另一种方法是

echo.>test.html

回声。> test.html

both are working 100% fine

两者都可以 100% 正常工作

回答by Jamaxack

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

如果您尝试在 ReactNative 中使用 TypeScript,请首先运行:

npm install touch-cli -g

and then you can use touch, example:

然后你可以使用触摸,例如:

touch rn-cli.config.js

回答by thefett

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

只需通过 Windows 上的 GitBash 终端运行它,它就可以正常工作

回答by thefett

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

,与 copy 一起使用以指示缺少的参数。这会更新文件的修改日期。例如copy /b file1,,