Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

Flutter and Dart -> add path on Ubuntu 20.04

I am trying to add flutter to the path but no solution is working for me right now. It was working before when I installed it from snap. Now I am cloning flutter repo into the opt folder and No matter what I try, flutter is not working. I am using ZSH terminal. So far I have tried:

  1. Adding export PATH=~/opt/flutter/bin:$PATH on last line of .zshrc and .bashrc file.
  2. Running export PATH="$PATH:~/opt/flutter/bin" on the terminal.

And bunch of other tweaks on the keywords but none of the things seems to work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try this if you mean you have cloned flutter to /opt folder

export PATH="$PATH:/opt/flutter/bin"

Also if you doesn't mean that and you solely mean ~/opt folder then first verify your flutter installation by typing ~/opt/flutter/bin/flutter in your terminal,
It should launch flutter it your terminal if not then either your installation is broken or you have to type chmod +x -R ~/opt/flutter/bin to make flutter executable if it's not.

PS: Also don't forget to restart your shell if you haven't cause you have to restart you shell after changing something in your .rc files.

I hope I have helped you if not please comment so that I can improve the answer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...