zsh: command not found: pub
Asked Answered
S

5

13

I'm getting this error message when try to install aqueduct on macOS Catalina with this command.

pub global activate aqueduct

I managed to install it by putting flutter in front of it but now I cannot run aqueduct. I tried

aqueduct --version

I get an error again

zsh: command not found: aqueduct

Here is my .zshrc file (I've added last second line to try to fix it)

export PATH="$PATH:/Users/peter/development/tools/flutter/bin"
export PATH="$PATH":"$HOME/.pub-cache/bin"

I don't know what else to do...

Shotten answered 25/4, 2020 at 17:14 Comment(12)
did you get the same error on bash ?Heliozoan
@HugoS No I get The default interactive shell is now zsh. To update your account to use zsh, please run 'chsh -s /bin/zsh'.Shotten
@HugoS should I ran that command?Shotten
even with bash I get the error bash: aqueduct: command not foundShotten
Have you checked if there's a binary file aqueduct in folders "$PATH:/Users/peter/development/tools/flutter/bin" or "$PATH":"$HOME/.pub-cache/bin", and that it's permissions are rwx ?Communal
@OlhaPavliuk there seems to be no files aqueduct in "$PATH:/Users/peter/development/tools/flutter/bin" and there is no folder ".pub-cache" in my home directoryShotten
Have you installed Dart: dart.dev/get-dart ? This is required before setting up aqueductCommunal
like brew install dart and other stepsCommunal
@OlhaPavliuk I thought dart is installed together with flutter.... ok.. I'm doing it and let you knowShotten
@OlhaPavliuk that worked... can you put it as an answer so I can mark it as answeredShotten
@Shotten : Did you check your PATH? Not by looking into your .zshrc, but by doing a echo $PATH just before running the command.Ergener
@Ergener No i did not... but to be honest i think it only needed to install brew.. everything is working now. I had to reinstall xcode after that but i managed that as well after an hour of waitingShotten
C
4

Well, I don't know what is aqueduct, but this is a common way to solve such issues:

  1. When you see $ zsh: command not found: aqueduct,

run $ which aqueduct - it shouldn't work.

If it works, then the shell does know about a binary named aqueduct.

  1. Find out in which folder aquedict is located, and add the path to it in export PATH=..., like in you did in .zshrc file.

  2. If you found aquedict binary, and it still fails to work, try adding it permissions to execute:

chmod +rwx aquedict

  1. If you didn't found aquedict binary, read the docs again. :)

In your case it's https://aqueduct.io/docs/getting_started/ ,

and the first step is to install Dart: https://dart.dev/get-dart

Communal answered 25/4, 2020 at 18:22 Comment(0)
J
25

Edit zshrc file using vim on terminal

vim ~/.zshrc

edit data on zshrc after pressing "i" on keyboard. Export flutter location, aqueduct location and dart sdk location.

NOTE, to change the your_path to your flutter directory. i.e where flutter is installed.

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

After editing press "esc" key and type :wq for saving Check working of aqueduct using

aqueduct --version

or

aqueduct serve
Joanjoana answered 29/6, 2020 at 17:16 Comment(0)
V
12

If you have flutter installed, try flutter pub global activate aqueduct

Vampire answered 27/10, 2020 at 17:51 Comment(0)
D
6

I got this error zsh: command not found: pub

quick answer if you already have flutter installed

run

flutter pub get

because You can either download the Dart SDK directly (as described below) or download the Flutter SDK, which (as of Flutter 1.21) includes the full Dart SDK.

In my case I wanted to install dependencies in pubspec.yaml in my dart project, but got zsh: command not found: pub.

What is pub

The pub tool has commands for managing packages and for deploying packages and command-line apps.

Deafen answered 3/11, 2020 at 19:44 Comment(0)
C
4

Well, I don't know what is aqueduct, but this is a common way to solve such issues:

  1. When you see $ zsh: command not found: aqueduct,

run $ which aqueduct - it shouldn't work.

If it works, then the shell does know about a binary named aqueduct.

  1. Find out in which folder aquedict is located, and add the path to it in export PATH=..., like in you did in .zshrc file.

  2. If you found aquedict binary, and it still fails to work, try adding it permissions to execute:

chmod +rwx aquedict

  1. If you didn't found aquedict binary, read the docs again. :)

In your case it's https://aqueduct.io/docs/getting_started/ ,

and the first step is to install Dart: https://dart.dev/get-dart

Communal answered 25/4, 2020 at 18:22 Comment(0)
I
0

If flutter is present but for pub it show zsh: command not found: pub then use flutter pub instead of pub eg : flutter pub lottie this will add lottie as dependency

Iroquois answered 18/4 at 18:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.