在CMD中使用 ‘make copy’ 命令时出现错误 (e=2):系统找不到指定的文件。

huangapple go评论54阅读模式
英文:

Use on CMD 'make copy' make (e=2): The system cannot find the file specified

问题

以下是您提供的内容的中文翻译:

我在尝试从存储库构建WEB包时遇到了问题。

copy forbidden.html build\testing\forbidden.html
process_begin: CreateProcess(NULL, copy forbidden.html build\testing\forbidden.html, ...) failed.
make (e=2): 系统找不到指定的文件。
make: *** [Makefile:16: copy] 错误 2


有人可以帮我解决这个问题吗?可能是什么问题?

我在Path中使用了git-local\bin,当我删除它时,make copy在cmd中可以工作。

$(info $(SHELL))我添加到makefile中,shell返回git_local\bin\sh.exe

当我从Path中删除了git,只有sh.exe出现

“您的文件路径中有空格,这意味着您必须使用引号括起包含空格的路径。” 我尝试了,但没有效果。
英文:

I have a problem when i would like to build WEB package from repostory.

copy forbidden.html build\testing\forbidden.html
process_begin: CreateProcess(NULL, copy forbidden.html build\testing\forbidden.html, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:16: copy] Error 2

can someone help me with this, what could be the problem?

I use on git-local\bin on Path and when i delete then working the make copy on cmd.

$(info $(SHELL)) I added to makefile on the shell give back git_local\bin\sh.exe

when I deleted git from the path, only sh.exe appeared

"The path of your file has a space in its name, which means you have to surround the path which contains spaces with quotation marks." I tried but not working

答案1

得分: 0

GNU `make`在Windows上会优先使用一个POSIX shell,`sh.exe`,如果它可以在PATH中找到的话。如果找不到,那么`make`会退而使用`cmd.exe`。

你显示的错误暗示着`make`在你的`PATH`中找到了一个`sh.exe`,所以正在使用它。由于`make`没有使用`cmd.exe`,你无法在你的配方中运行任何`cmd.exe`内置程序,比如`copy`。

如果你希望这个makefile始终使用`cmd.exe`,你可以通过将以下内容添加到你的makefile中来指定:

    SHELL := cmd.exe
英文:

GNU make on Windows will prefer to run a POSIX shell, sh.exe, if it can be found on the PATH. If it can't be found, then make will fall back to cmd.exe.

The error you show implies that make found a sh.exe on your PATH and so is using that. Because make is not using cmd.exe you can't run any cmd.exe built-in programs like copy in your recipe.

If you always want your makefile to use cmd.exe with this makefile, you can specify that's what you want by adding this to your makefile:

SHELL := cmd.exe

huangapple
  • 本文由 发表于 2023年2月24日 00:36:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75547728.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定