3

I am trying to run an Angular project and to do that I have installed node, yarn and angular cli. After installing angular cli using command: yarn global add @angular/cli it said that success: Installed "@angular/cli@1.7.4" with binaries: - ng.

But when I am trying to create a project using ng it said Command 'ng' not found.

The output of node -v: 8.11.1
yarn -v: 1.6.0
My Ubuntu version is 18.04

Please help, I am very much new to Ubuntu.

The output of yarn global bin: /home/amrinder/.yarn/bin

emk2203
  • 4,166
  • 1
  • 21
  • 47

1 Answers1

3

According to yarn cli, your global package executables are in ~/.yarn/bin location. You will need to add this path to your $PATH variable. Read How to add a directory to the PATH? to see how to do that.

Or you need to reinstall using the command:

yarn global add @angular/cli --prefix /usr/local

which will install in /usr/local/bin which should already be in $PATH variable.

You can permanently set this in config as:

yarn config set prefix /usr/local
Suraj Rao
  • 627