pub全局激活命令-$ HOME / .pub-cache / bin不在路径上 [英] pub global activate command - $HOME/.pub-cache/bin not on path

查看:870
本文介绍了pub全局激活命令-$ HOME / .pub-cache / bin不在路径上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近尝试安装dart2,但是当我尝试安装 pub全局激活stagehand 时,它带有警告。

I was trying to install dart2 recently, but when I try to install pub global activate stagehand, it comes with a warning.


警告:Pub将可执行文件安装到 $ HOME / .pub-cache / bin ,该路径不在您的路径上。

Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.

您可以通过将其添加到Shell的配置文件中来解决此问题( .bashrc .bash_profile 等):

You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):

export PATH="$PATH":"$HOME/.pub-cache/bin"

所以我转到我的 .bash_profile 文件并添加了上面的文件,文件看起来像这样:

so i went to my .bash_profile file and added the above, and the file looks like this:

export PATH=/users/kevinau/dart/flutter/bin:$PATH
export PATH="$PATH":"$HOME/.pub-cache/bin"

但是随后我运行 webdev ,命令仍然没找到。

but then I run webdev and the command is still not found.

有人可以引导我解决此问题吗?

can anyone walk me thru how to fix this?

我试过echo $ PATH 并返回以下内容:

I tried echo $PATH and return the below:

/users/myspace/dart/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/sbin/.pub-cache/bin

但是我该如何解决?

推荐答案

添加dart-sdk .bash_profile

Add dart-sdk path to .bash_profile

export PATH="$PATH:`pwd`/flutter/bin"
export PATH="$PATH:`pwd`/bin/cache/dart-sdk/bin"
export PATH="$PATH:`pwd`/.pub-cache/bin"

这篇关于pub全局激活命令-$ HOME / .pub-cache / bin不在路径上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆