I am new in haskell programming. For my university project our teacher send us the project and ask us to run these command : "stack init" then "stack build" when i am running stack build a got this error :
Project.cabal was modified manually. Ignoring Project\package.yaml in favor of the Cabal file.
If you want to use the package.yaml file instead of the Cabal file,
then please delete the Cabal file.
Executable named sh not found on path: ....."Path"
Can anyone help solve the problem please ?
remove all project and try again .
In general,
stack initis only run once to initialize a new project. You would typically run this in an empty directory, where it will create astack.yamlfrom some template.This template
stack.yamlmostly contains comments that explain you all the different options.However, you could also manually create it, like for instance:
Once you have your
stack.yamlin place, there are two options:You can either use a traditional
<your-project-name>.cabalfile, or write apackage.yamlfile. See https://github.com/sol/hpack for details on how to write such a file.When you use
stack build, and there is only a.cabalfile and nopackage.yaml, then Stack will use that.However, if a
package.yamlexists, then Stack will automatically create and update the<your-project-name>.cabalfile for you.And prior to doing so, it will check whether that file is newer than the
stack.yamlorpackage.yaml, to avoid possibly overwriting any manual changes in that file.So the error message that you're getting should normally mean that someboy (ie. your teacher) manually edited the
Project.cabalfile although apackage.yamlexists.However, what is puzzling about it is that normally, both files should be in the project's root directory - but your error message contains a Windows-style path-name in it.
Then, there is the ever more troubling last line - about
shnot found on path.Is it possible that you are trying to run this on Windows?
I have never used Haskell on Windows myself, so I have no clue about how that should work. But an error message about the Linux / Unix command interpreter
shnot being found would be typical for some Linux / Unix software that's not been fully ported to Windows yet.I am also solely basing my "Windows suspicion" on the first line of the error message, which contains a path with a backslash in it, as it would on Windows.
But maybe my general description of the Stack build process can help shed some light on this as well.