yesod init命令在Windows上不起作用 [英] yesod init command does not work on Windows
问题描述
mkdir mypackage
cd mypackage
cabal update
cabal sandbox init
cabal install yesod-platform yesod-bin --max-backjumps = -1 --reorder-goals
当我尝试执行 yesod init
时,我收到了一条错误消息。
'yesod'不被识别为内部或外部命令,可操作程序或批处理文件。
我使用搜索来查找任何类似yesod的文件,但我找不到任何 yesod.exe
或类似的东西。我搜查了整个C:驱动器。
yesod命令发生了什么?
yesod.exe文件应该在 mypackage / .cabal-sandbox / bin / yesod.exe中。
。如果不存在,请尝试再次安装yesod-bin。该目录不会添加到路径中,因此Windows命令行无法找到yesod.exe。尝试从mypackage目录中的命令行执行以下操作:
.cabal-sandbox\bin\yesod init
当您想运行开发服务器时,您会遇到同样的问题。我通过在项目目录中创建一个名为devel.bat的文件,并在以下内容中解决了这个问题:
set PATH =%PATH%;%CD%\.cabal-sandbox\bin
yesod devel
<然后运行该文件启动开发服务器。
I did the following steps to install the Yesod web framework.
mkdir mypackage
cd mypackage
cabal update
cabal sandbox init
cabal install yesod-platform yesod-bin --max-backjumps=-1 --reorder-goals
When I then tried to do yesod init
, I got an error message.
'yesod' is not recognized as an internal or external command, operable program or batch file.
I used search to find any yesod-like file but I couldn't find any yesod.exe
or anything like that. I have searched the entire C: drive.
What happened to the yesod command?
The yesod.exe file should be in mypackage/.cabal-sandbox/bin/yesod.exe.
. If its not there, try to install yesod-bin again. This directory is not added to the path so the windows command line cannot find yesod.exe. Try this from a command line in the mypackage directory:
.cabal-sandbox\bin\yesod init
You will have the same problem when you want to run the development server. I solve this on my windows pc by creating a file called devel.bat in the project directory with the following contents:
set PATH=%PATH%;%CD%\.cabal-sandbox\bin
yesod devel
Then run the file to start the development server.
这篇关于yesod init命令在Windows上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!