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

3 Answers3

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.

Eric Carvalho
  • 55,453
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
Jossef Harush Kadouri
  • 5,326
  • 2
  • 23
  • 23
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