Make command fails

Working in Windows 11 - there is no native make command. I tried mingw32-make (which I do have installed) and that runs but an error is thrown in the very first starter project:

Running “flutter pub get” in starter… 1,431ms
for feature in packages/features/quote_details packages/features/update_profile packages/features/sign_up packages/features/forgot_m
y_password packages/features/profile_menu packages/features/sign_in packages/features/quote_list; do
cd ${feature} ;
echo “Updating dependencies on ${feature}” ;
flutter pub get ;
cd …/…/…/ ;
done
feature was unexpected at this time.
mingw32-make: *** [makefile:24: get] Error 255

Any help appreciated.

1 Like

The make command is defined inside the makefile that lives in your projects’ root folder. It doesn’t depend on your OS.
Are you sure you’re running the command from your the project’s root folder? You can check that by running the ls command first and checking if there’s a makefile listed in there.

1 Like

Here is a try from a terminal window…obviously, on Windows we need some type of make.exe file to “make” (pun intended) this work.

There doesn’t seem to be a “make” command in the makefile either.

C:\dev\rwflutter\starter>dir makefile

Directory of C:\dev\rwflutter\starter

10/06/2022 06:09 AM 2,360 makefile
1 File(s) 2,360 bytes
0 Dir(s) 1,615,214,260,224 bytes free

C:\dev\rwflutter\starter>make get
‘make’ is not recognized as an internal or external command,
operable program or batch file.

Can you try following the instructions outlined in the accepted answer here?
If that works we’ll include it in the next edition of the book.

2 Likes

I tried the suggested solution. This one:

=============================================

  1. The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :
choco install make
`=============================================

So, I had make installed. 

Then I tried make get from a terminal and came up with the same error that I originally got when I tried doing this with mingw32-make as outline in my first post.

Here is the error again:

C:\dev\rwflutter\starter>make get
flutter pub get
Running "flutter pub get" in starter...                            12.1s
for feature in packages/features/forgot_my_password packages/features/profile_menu packages/features/quote_details packages/features/quote_list packages/features/sign_in packages/features/sign_up packages/features/update_profile; do \
        cd ${feature} ; \
        echo "Updating dependencies on ${feature}" ; \
        flutter pub get ; \
        cd ../../../ ; \
done
feature was unexpected at this time.
make: *** [makefile:24: get] Error 255

C:\dev\rwflutter\starter>
2 Likes

Also have the same problem
done
feature was unexpected at this time.
make: *** [makefile:24: get] Error 255
Windows 10, also Chocolatey for make installation

Hi! Do you have any solutions to this error? Thanks!

@chazmanian @marvik

Also Win 10 with Chocolatey here, same error “feature was unexpected”.

This is a UNIX makefile on Windows… ugly hack but it worked. Replaced everything in the get: function with:

	flutter pub get
	for /D %%F in ("packages/features/*") do (cd "%cd%\packages\features\%%F" & echo Updating dependencies on %%F & flutter pub get)
	for /D %%P in ("packages/*") do (cd "%cd%\packages\%%P" & echo Updating dependencies on %%P & flutter pub get)

This doesn’t fix the rest of the makefile for Win and isn’t pretty. If I continue with the book maybe I’ll revisit.

3 Likes

Sadly your command doesn’t work for me :confused: I keep getting the same message “makefile:23: *** missing separator. Stop.”

I preferred to do a dual boot than trying to solve this, since I haven’t found any good material regarding this.

Facing the same issue. Still no solution??

1 Like

I just found a solution.

So after installing make as pointed out by @ebueno through the StackOverflow link - I installed through chocolate. I just thought to open my git bash terminal which came with installing git and navigated to the starter project directory, and then ran the make get command and it worked.

The following may not be relevant;
I initially installed the make file by just searching Google. So when I saw that it could be installed through chocolate, as I already had this on my PC, I uninstalled the one I already had, and reinstalled it through chocolate as directed by the StackOverflow answer pointed out by @ebueno - hoping it would make a difference. I’m not sure it did, because I got the same error.

I also restarted by PC after installing via chocolate. I’m also not so sure that made any difference, as I still got the same error while running on vscode terminal.

Yes I was using the powershell terminal on vscode, and that was not working. So I’m guessing the make command needs a linux terminal to work, probably that is why it worked on the git bash terminal.

Also vscode has provision for switching to different kind of terminal, command prompt, powershell, and git bash. I think it also works if you use the git bash terminal in vscode

3 Likes

Thanks, git bash terminal really works!

1 Like

Hi all,

I managed to find a simple solution to this using the GOW (GNU on Windows) Unix command line utilities installer for Windows. Located here.

With this, I installed the package and made sure the bin directory was added to my path. I am now able to run the make command (and many others) without issues.

3 Likes