Reputation: 791
After installation of yo using this command:
npm install -g yo
i got the following output:
/Users/admin/npm/bin/yo ->
/Users/admin/npm/lib/node_modules/yo/lib/cli.js
/Users/admin/npm/bin/yo-complete ->
/Users/admin/npm/lib/node_modules/yo/lib/completion/index.js
> [email protected] postinstall /Users/admin/npm/lib/node_modules/yo
> yodoctor
Yeoman Doctor Running sanity checks on your system
✔ Global configuration file is valid ✔ Node.js version ✔ No .bowerrc file in home directory ✔ No .yo-rc.json file in home directory ✔ npm version ✔ NODE_PATH matches the npm root
Everything looks all right! /Users/admin/npm/lib └── [email protected]
But when i run
yo --version
i got: command not found: yo
Upvotes: 0
Views: 5149
Reputation: 210
You need to add /Users/admin/npm/bin/
to your PATH-variable. To do that just add export PATH="/Users/admin/npm/bin:$PATH"
to your .bash_profile
which resides in your home directory, so you don't have to manually change your path every time you start the terminal application.
In order to make that work you need to restart the terminal or manually execute your bash_profile. To check if everything worked out just output your path (using the command echo $PATH
) and check if the added directory is part of it. Then also the command which yo
should point you to the correct executable.
Upvotes: 2