问题
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?
回答1:
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.
回答2:
Yesod init is disabled and you have to use the stack.Please refer this https://www.yesodweb.com/page/quickstart
来源:https://stackoverflow.com/questions/24671225/yesod-init-command-does-not-work-on-windows