Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yo: command not found

Tags:

npm

ubuntu

yeoman

I've installed nodejs with chris lea's version:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm

Than installed yeoman, grund-cli and bower using npm:

sudo npm install -g yo grunt-cli bower

Everything went alright including the "[Yeoman Doctor] Everything looks alright!" at the end of yeoman's install.

/home/gabriela/npm/bin/yo -> /home/gabriela/npm/lib/node_modules/yo/cli.js
> [email protected] postinstall /home/gabriela/npm/lib/node_modules/yo
> node ./scripts/doctor

Than I run:

gabriela@Gabriela-Ubuntu:~$ which node
/usr/bin/node
gabriela@Gabriela-Ubuntu:~$ which npm
/usr/bin/npm
gabriela@Gabriela-Ubuntu:~$ which bower
/usr/bin/bower
gabriela@Gabriela-Ubuntu:~$ which yo
gabriela@Gabriela-Ubuntu:~$ yo
yo: command not found
gabriela@Gabriela-Ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$JAVA_HOME:$JRE_HOME

What went wrong? Do I have to execute any other command to install yeoman properly?

like image 420
Gabriela Vasselai Avatar asked Jun 03 '14 22:06

Gabriela Vasselai


2 Answers

I really don't know why the heck it got lost. So after a bunch of tests I resolved creating a symbolic link.

gabriela@Gabriela-Ubuntu:/$ sudo ln -s /home/gabriela/npm/bin/yo /usr/bin/yo
gabriela@Gabriela-Ubuntu:/$ yo
[?] What would you like to do? (Use arrow keys)
‣ Run the Angular-bootstrap generator (0.4.1) 
  Update your generators 
  Install a generator 
  Find some help 
  Get me out of here!
like image 124
Gabriela Vasselai Avatar answered Nov 14 '22 17:11

Gabriela Vasselai


from the documentation getting started yo will install bower and grunt. what you need to do is to delete grunt and yo then re-install just yo

npm uninstall -g grunt yo

npm install -g yo

npm install -g yo

If you are using npm 1.2.10 or above, this will also automatically install grunt and bower for you. If you're on an older version of npm, you will need to install them manually

If you have installed Grunt globally in the past, you will need to remove it first: npm uninstall -g grunt

like image 1
mamdouh alramadan Avatar answered Nov 14 '22 15:11

mamdouh alramadan