17

I've installed Dart according to instructions from the official website (https://www.dartlang.org/tools/debian.html). To be more exactly:

$ sudo apt-get update
$ sudo apt-get install apt-transport-https
# Get the Google Linux package signing key.
$ sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
# Set up the location of the stable repository.
$ sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
$ sudo apt-get update
$ sudo apt-get install dart

Installation was successful, but some time later I found that there is no other related commands like pub, dart2js.

pub: command not found
dart2js: command not found

What's wrong?

OS: Ubuntu 14.10

21

I know nothing about Dart, yet I downloaded the deb and looked inside it. The files you're looking for are located at /usr/lib/dart/bin/. You're getting "command not found" because that directory is not in $PATH.

You should be able to run them by providing the full path:

/usr/lib/dart/bin/dart2js

Or you may want to add /usr/lib/dart/bin to $PATH.

| improve this answer | |
  • Thanks, I've already installed Dart manually using ~/.profile :) – Timur Fayzrakhmanov Mar 22 '15 at 13:47
  • 1
    I decided, "pub" was a little vague or too general. So i made a link instead, ln -s /usr/lib/dart/bin/pub ~/bin/util/dart-pub -- I could have called it "pub", the main point from my side is that ~/bin/util is already in my PATH. – will Mar 10 '16 at 12:54
4

Another way to fix it using symlinks

sudo ln -s /usr/lib/dart/bin/pub /usr/bin/pub
sudo ln -s /usr/lib/dart/bin/dart2js /usr/bin/dart2js
| improve this answer | |
1

I know it's a bit late , but I am putting this for future reference As @Eric mentioned , dart directory needs to be added to your PATH .

These steps can be followed to add /usr/lib/dart/bin to your PATH on ubuntu:

$ sudo nano .profile

Then add this line to your .profile file :

export PATH=$PATH:/usr/lib/dart/bin

Then you need to reload your .profile file :

. ~/.profile
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.