brunodd
brunodd

Reputation: 2584

-bash: yo: command not found

Like a lot of people I am also having issues with Yeoman. Error -bash: yo: command not found in OSx.

I tried adding export PATH=/usr/local/share/npm/bin:$PATH on my .bash_profile as suggested by some folks and still same error.

I've lost 2 hours of my productivity trying to fix Yeoman bugs and still nothing.

Does anyone know any good solution that fixes the -bash: yo: command not found ?

Upvotes: 3

Views: 10351

Answers (5)

user7064150
user7064150

Reputation: 1

just give access for the user to read write execute in the folder webapp

sudo chmod 777 webapp
cd webapp
yo angular [appname]

Upvotes: 0

ACV
ACV

Reputation: 10562

This also seems to work :)

sudo `yo angular2-ts [appname]`

where [appname] is the name of your app (without the []) :)

Upvotes: 0

fgirardey
fgirardey

Reputation: 151

I found that for recent versions of npm, all node packages are installed in the ~/npm/bin/ directory.

So add those lines to your $PATH in the .profile file :

export PATH=$PATH:~/npm/bin

Then do :

source ~/.profile
yo -v

Upvotes: 13

brunodd
brunodd

Reputation: 2584

Finally found a solution for this.

First I had to uninstall and install yo again:

npm remove -g yo
npm install -g yo

I also added a symlink to the bash_profile to make yo work. The following line: PATH=${PATH}:~/.node/bin After that restart the prompt for the change to take action.

Please check this for more references: Why are my Yeoman generators installing in the wrong place?

Upvotes: 4

InvAdErZz
InvAdErZz

Reputation: 49

try to add an symbolic-link (ln -s) into the /sbin -directory. like:

ln -s /sbin/ /usr/local/share/npm/bin/yo

Upvotes: 0

Related Questions