Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pub global activate command - $HOME/.pub-cache/bin not on path

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

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

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

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

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"

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

can anyone walk me thru how to fix this?

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

but how do I fix it?

like image 756
Kevin Avatar asked Oct 13 '18 15:10

Kevin


People also ask

Which is not on your path you can fix that by adding this to your shell's config file?

pub-cache/bin, which is not on your path. You can fix that by adding this to your shell's config file (. bashrc, . bash_profile, etc.):

How do I install pub darts?

To find the path to pub , you can install dart with your . deb installation file, and open the synaptic package manager (type sudo synaptic from the command-line; install synaptic first, if it's not installed— sudo apt-get install synaptic ), find dart in the Synaptic Package Manager. Right click on dart .


2 Answers

I have just run the following command in my cmd

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

then I again run the command dart pub global activate fvm and the error is gone. In my case, I am having the error during installing fvm package.

like image 62
MRazaImtiaz Avatar answered Sep 20 '22 08:09

MRazaImtiaz


For Windows

Add C:\flutter\.pub-cache\bin into your system variable path

like image 45
Rishi Malgwa Avatar answered Sep 19 '22 08:09

Rishi Malgwa