When I tried to add flutter to windows environment, my WSL is not happy Im getting this error.
/usr/bin/env: ‘bashr’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
This will only happen if I add flutter to windows environment variables.
Any tips how I can fix this?
2
Answers
The cause of the problem was, when I add the flutter command on the windows environment variables path, all the windows
env
will be also carried on theWSL
this will in turn make the windowsflutter
command have a priority.And when I enable the flutter bash completion
this will use the flutter executable from windows and bash doesn't like it.
The simple fix is to priority the
wsl
local flutter binary.This fixed the problem.
Your script is a Windows-formatted text file, which bash doesn’t like, not even in WSL. Save it without the carriage returns.