Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No executable found matching command "dotnet-fable"" #1073

Closed
alexfoxgill opened this issue Jul 16, 2017 · 39 comments
Closed

"No executable found matching command "dotnet-fable"" #1073

alexfoxgill opened this issue Jul 16, 2017 · 39 comments

Comments

@alexfoxgill
Copy link

I've followed the getting started guide and have run into this error:

$ dotnet fable
No executable found matching command "dotnet-fable"

I am running Windows 10 and have followed the guide to the letter as far as I'm aware. I have tried several times with a clean directory, and have rebooted my computer. How can I diagnose what I am missing?

@MangelMaxime
Copy link
Member

Hello, did you run the command from src folder?

@alexfoxgill
Copy link
Author

No! That works! Thank you.

@MangelMaxime
Copy link
Member

Your welcome sorry, the docs was updated but not published.

@isaacabraham
Copy link

@MangelMaxime I know this is an old issue but I just created a new Fable project using the template and had to explicitly add the line dotnet-fable into the paket.references of the created project before dotnet fable would show up. Is that expected?

@MangelMaxime
Copy link
Member

@isaacabraham If you used the new fable template there is a change where the dotnet-fable tool is attached.

Look at the instruction in the readme to know how to use the template.
https://github.com/fable-compiler/fable-templates/tree/master/simple/Content#building-and-running-the-app

This is indeed expected, in order to hide most of the tools under tools folder. But IMO we will tend to have something like the structure of Fulma-minimal.

In Fulma-minimal, we have a build.proj at the root folder. Where we attach dotnet-fake, dotnet-fable and in the future dotnet-paket.

@isaacabraham
Copy link

OK. Indeed the yarn process works fine - but the getting started on the Fable homepage give instructions to try out dotnet fable which won't work.

@MangelMaxime
Copy link
Member

On this page for me the only reference to dotnet-fable is:

The Fable daemon must be invoked in a directory with an .fsproj including a reference to the dotnet-fable package.

And the instruction for the template on the page is:

  • Install dependencies: yarn
  • Start Fable daemon and Webpack dev server: yarn start
  • In your browser, open: http://localhost:8080/

It looks fine to me.

@isaacabraham
Copy link

If I cd into the src folder (which contains the fsproj) and run dotnet fable it errors with "No executable found matching command "dotnet-fable"". If I do it from the tools folder (as is done in yarn start) then it works fine.

@MangelMaxime
Copy link
Member

Yes, this is expected behavior because the .fsproj ni the src folder do "not include a reference to the dotnet-fable package".

Can be indeed hard to new people to understand but they would probably not try to use the advance section. Or we could add: "If you encounter error No executable found matching command "dotnet-fable"" then the reason is XXXX

@isaacabraham
Copy link

Yep. Why not just include the fable cli to the paket references and it'll just work - the tooling is already in the deps file? Alternatively, change the docs to tell people to run it from the tools folder?

It just seems kind of misleading - I just followed the docs now and fell into this trap.

@alfonsogarciacaro
Copy link
Member

Seems reasonable, PR? :)

@isaacabraham
Copy link

I was waiting for that :-)

@isaacabraham
Copy link

Alternatively, just remove the quick start guide and point people towards the readme if that's the real source of truth.

@yetanotherlogonfail
Copy link

yetanotherlogonfail commented Jun 29, 2018

still broken ? barrier to entry

@MangelMaxime
Copy link
Member

@yetanotherlogonfail The template is not broken the instruction in the guide isn't up to date. Please follow the instruction from the readme.md file as stated:

Below we will see the steps to run the app, but always check the README file in case instructions change in future versions of the template.

We do need to change the documentation. And probably need to make point toward the readme as stated by @isaacabraham (will send a PR so it will be done)

@kristianmandrup
Copy link

Please make the Getting started more visible. I only found it through a Medium article, almost by chance. Should be prominent on the fable.io site IMO. Either as a clear concise set of instructions or via a big fat button linking to a page that clearly spells out the steps to get the first apps running.
Cheers :)

@kristianmandrup
Copy link

~/repos/fable-projects/elmish-react-app 
09:53 $ dotnet fable npm-run build 
No executable found matching command "dotnet-fable"

Trying from /src as suggested

dotnet fable npm-run build
No executable found matching command "dotnet-fable"
✘-1 ~/repos/fable-projects/elmish-react-app/src 

@kristianmandrup
Copy link

"If I cd into the src folder (which contains the fsproj) and run dotnet fable it errors with "No executable found matching command "dotnet-fable"". If I do it from the tools folder (as is done in yarn start) then it works fine."

Where is the tools folder?

I created a new elmish-react app using the template as per the instructions in a getting started guide: getting-started-with-fable-and-fable-elmish

NuGet.Config        
RELEASE_NOTES.md     
node_modules
package.json
paket.lock           
sass                 
webpack.config.js
README.md            
elmish-react-app.sln 
package-lock.json    
paket.dependencies
public               
src                  
yarn.lock

Please advice. Thanks

@kristianmandrup
Copy link

Now tried following README instruction of project. Into /src folder and ran dotnet restore now complains it can't find mono. How best to install or configure mono on MacOSX for Fable/F# or .NET?

@kristianmandrup
Copy link

Seems I need to follow this guide: https://fsharp.org/use/linux/

@kristianmandrup
Copy link

Looks like that doesn't work either. I've just installed the .NET SDK and thought mono was included there... hmm, guess it makes kinda sense it isn't but then should warn about it at least?

I can see I don't have either compiler or interactive available?

~/repos/fable-projects/elmish-react-app/src 
10:36 $ fsharpc
-bash: fsharpc: command not found
✘-127 ~/repos/fable-projects/elmish-react-app/src 
10:39 $ sharpi
-bash: sharpi: command not found
✘-127 ~/repos/fable-projects/elmish-react-app/src 
10:39 $ fsharpi
-bash: fsharpi: command not found

Trying this guide now: https://www.mono-project.com/docs/getting-started/install/mac/

@alfonsogarciacaro
Copy link
Member

Hi @kristianmandrup! Have you checked the minimal Fable 2 sample? Since Fable 2.1, the distribution is done through npm (basically you don't need to worry about anything if you install the latest fable-loader for Webpack), so you don't need to run dotnet fable anymore. Just add the fable-loader to your Webpack config and fire it (e.g. npx webpack-dev-server).

@kristianmandrup
Copy link

Thanks will try anything ;) super excited about Fable!! I'm on a MacOSX. Installing Mono now. I think your getting started mostly assumes a Windows machine?

@kristianmandrup
Copy link

First steps first ;) gotta set up my environment for .NET and F# first...
Preconditions

@kristianmandrup
Copy link

dotnet restore working after mono pkg install :)

@alfonsogarciacaro
Copy link
Member

I'm on macOSX too since I started to write the very first version of Fable :) Now you only need mono if you want to use Paket to manage Nuget dependencies. It Paket is not used (as in the minimal sample), the dotnet SDK should be enough (we're using 2.1.x, not sure if 2.2.x can also run Fable).

I'm happy to hear you're excited about Fable! It's true it's a bit complicated to get started with the tooling at first, I'm sorry about that. We're planning to update the website and the documentation, but it will still take a bit.

@kristianmandrup
Copy link

haha :) I can imagine. So much todo, hard to do it all - so many priorities.

I downloaded and installed: dotnet-sdk-2.2.103-osx-gs-x64.pkg

Not Core. Guess I should install Core as well? or remove the dotnet SDK first?

Was complaining about missing mono. Perhaps needed manual PATH entry in ~/.bash_profile?

Then installed MonoFramework-MDK-5.16.0.220.macos10.xamarin.universal.pkg, then it could find mono, no sweat.

Also have your minimal sample from my fork of fable-samples up and running :)
Cheers!

@alfonsogarciacaro
Copy link
Member

alfonsogarciacaro commented Jan 25, 2019

The dotnet SDK already includes the Core runtime so that should be fine :)

Hmm, it seems the "Getting started with Fable and Fable Elmish" guide is a bit old. I'd recommend checking the SAFE-stack which probably has the best documentation at the moment and also helps you set up the server side.

@kristianmandrup
Copy link

I will look into the SAFE stack as well. Thank you so much Alfonso.

@kristianmandrup
Copy link

kristianmandrup commented Jan 25, 2019

OK, turned out I had to install xcode again since it was out of date (new OS release?).
Anyways, now I get:

ENOENT: no such file or directory, open '/Users/kristianmandrup/repos/fable-projects/elmish-react-app/src/elmish_react_app.fsproj'

Turns out the file generate is called elmish-react-app.fsproj' since I named the project elmish-react-app. I have a elmish-react-app.sln in the root. Looks like a bug in the template generator.

elmish/react#35

@yetanotherlogonfail
Copy link

yetanotherlogonfail commented Jan 26, 2019 via email

@MangelMaxime
Copy link
Member

Hello @yetanotherlogonfail,
please remember that most of use are working on our free time so please stay calm and polite :)

Also, the project is Open Source, so you can propose a fix if you have a solution in general for the problem.

About the situation described on this issue, the error no executable found... is something generated by the dotnet cli and we can't catch it.

This is why now (from Fable 2.1), you invoke webpack directly as you would for any JavaScript project and it will start Fable directly.

@yetanotherlogonfail
Copy link

yetanotherlogonfail commented Jan 26, 2019 via email

@MangelMaxime
Copy link
Member

@yetanotherlogonfail The thing is that not all the problem you have are from Fable projects but related to the .Net ecosystem.

The dotnet restore thing is a problem from dotnet core and we can't fix it. We can only provide some patch, for example, Fable auto restore the project when starting a compilation when it detects a change in the fsproj etc.

If you like the stack and want to push it more, you are welcome to help fix the existing templates or to create a template that suits your needs for example and start from it.

If you want you can also start from fulma-demo repro which should work out of the box so you can remove the code and put your own.
Or fulma-minimal.
Or use fable minimal example.
Or SAFE-BookStore
Or SAFE-template

Most if not all of them, have documentation or explanations on how to run the project.

From my experience, they work out of the box and if you encounter a bug you can fill an issue and explain your problem. Then people will come to help you if needed. Also, by being friendly people will be more open to help you. It's a win-win situation.

If you think that F#, Fable or tech Y is "superior" to something else and is missing something you can also reach the community and work together with it to improve the situation.

@Zaid-Ajaj
Copy link
Member

THIS MUST work, or im out (as are 90% of people )..... and C++ rules, or
VB, python, java, scala, or whatever that does pass this simple test.
FAKE, Paket, all fail......
the past is littered with languages that fail not because they are weak,
because folks cant get over the simple "hello world" rule.

@yetanotherlogonfail

First of all Fake and Paket are optional
getting started with a console F# app is as simple as a console C# app and it works perfectly both in VS and VS Code

not just hello world, want to run a cross-platform web server? there you go

open Suave
let webApp = Successful.OK "Hello from Suave" 
startWebServer defaultConfig webApp

they all "just work"

In fact, In the past I had a lot of trouble getting scala and c++ to run on my machine because of the exact same reasons you mentioned above, it is not just F#.

that's why VB is still alive today as are access db applications. as are
plain old terminal applications.
hell at work I have trouble promoting F# over python, java and VB. when its
clearly superior.
lets take F#, not allowing nulls , great idea, love it, then in practice
the first query I do from a database in the real world and I have nulls in
my table , THAT'S REAL LIFE DUDE
2 weeks later, my code goes into production, written in scala, cos f#
offers not real examples of how to handle this. wasted.

So for this specific example, you bailed out on F# just because tables returned null? Of course there very simple ways to work with nulls from a database, for example with postgres using Npgsql.FSharp:

let getAllUsers() : User list =
    defaultConnection
    |> Sql.connect
    |> Sql.query "SELECT * FROM \"users\""
    |> Sql.executeTable 
    |> Sql.mapEachRow (fun row ->
        option {
            let! id = Sql.readInt "user_id" row 
            let fname = Sql.readString "first_name" row 
            let lname = Sql.readString "last_name" row
            return { 
                Id = id; 
                FirstName = defaultArg fname ""  
                LastName = defaultArg lname "" 
            }
        }) 

Similar code can be written to work with SqlClient to run against ms server

apologies for rant, but its embarrassing, big time.

I know your intensions are good and your frustration of not being able to use a great language because of poor tooling but rants don't help anyone, not even you. There are things we can do like building libraries to make things simpler and simpler, helping out in developing vs code instead of waiting for ms for better F# tooling and most importantly: helping out with writing build instructions you said were missing.

@kristianmandrup
Copy link

@yetanotherlogonfail Please be a little respectful. As they say, this is an Open Source project and much of this relies on 3rd party dependencies, Microsoft platform etc. which they/we have little to no control over.

I do think however that we can sometimes patch some of the inconsistencies or missing parts of said dependencies, such as running a post-generator step to "repair" file naming errors generated by the MS generator f.ex. Also, we could in principle create a script that checks the host system for certain platform components that are required and alert the user as to what parts need installation, possibly providing a guide as to how to remedy the situation (per platform).

Of course this is all an "ideal vision" and will take some effort, where we all need to do our part to make it a reality so as to make it easy for newbies to get up and running with the least amount of friction and "pain".

Your thoughts please. Cheers :)

@yetanotherlogonfail
Copy link

yetanotherlogonfail commented Feb 15, 2019 via email

@yetanotherlogonfail
Copy link

yetanotherlogonfail commented Feb 18, 2019 via email

@kristianmandrup
Copy link

@yetanotherlogonfail Perhaps clone, edit and make a PR? You can also have a look at my fable2-samples account, where I've tried to remedy some of these issues...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants