flutter配置环境变量时找不到前往~/.bash_profile,找不到
在配置flutter环境变量时,前往文件夹~/.bash_profile,发现找不到,找不到也意味着没有这个文件,在博客上查了一番,具体操作步骤如下:a.启动终端terminalb.进入当前用户的home目录:输入 cd ~c.创建.bash_profile: 输入touch .bash_profiled.编辑.bash_profile文件: 输入open -e .bash_profilee.保存
·
在配置flutter环境变量时,前往文件夹~/.bash_profile,发现找不到,找不到也意味着没有这个文件,在博客上查了一番,具体操作步骤如下:
a.启动终端terminal
b.进入当前用户的home目录:输入 cd ~
c.创建.bash_profile: 输入touch .bash_profile
d.编辑.bash_profile文件: 输入open -e .bash_profile
e.保存文件,关闭.bash_profile ,并更新刚配置的环境变量,输入 source .bash_profile
发现验证的时候报错 not valid in this context:https://storage.flutter-io.cn
bash_profile 文件的内容如下图:
又百度一番说是我的源有问题让换镜像源,然后我让用flutter开发过项目的同学看了我的配置文件,我同学说多了一个空格,我把空格删除又用source .bash_profile试了下,确实ok了,我问我同学你怎么看出是空格的问题,我同学说他的配置文件没有空格,哈哈哈...
原来是最后一行的“=”号后有一个空格,去掉就ok了,
更多推荐
已为社区贡献2条内容
所有评论(0)