0

I try to install yeoman but it's not working :

npm install -g yo 

/Users/john/npm/bin/yo-complete -> /Users/john/npm/lib/node_modules/yo/lib/completion/index.js
/Users/john/npm/bin/yo -> /Users/john/npm/lib/node_modules/yo/lib/cli.js
> yo@2.0.1 postinstall /Users/john/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!
+ yo@2.0.1
updated 1 package in 11.935s

john$ yo --version

-bash: /usr/local/bin/yo: No such file or directory

Pracede
  • 4,226
  • 16
  • 65
  • 110
  • I don't know why but yeoman was installed in /Users/john/npm/lib/node_modules/yo and not in /usr/local/bin. I added node modules in path and that works – Pracede Feb 21 '18 at 07:20

1 Answers1

0

Looking at your yo installation log.

The yo binary should be at /Users/john/npm/bin/yo. You can try doing a /Users/john/npm/bin/yo --version to confirm this.

If it responded accordingly and your machine is not seeing yo on yo --version. Then it is usually something to do with your PATH environment variable.

You'll have to make sure that the directory /Users/john/npm/bin/ is part of the $PATH environment variable, otherwise your machine will not know where to look for the yo binary.

Samuel Toh
  • 18,006
  • 3
  • 24
  • 39
  • $ /Users/john/npm/yo --version -bash: /Users/davykiala/npm/yo: No such file or directory – Pracede Feb 21 '18 at 06:09
  • I add /Users/john/npm/yo in $NODE_PATH but the command yo -bash: yo: command not found – Pracede Feb 21 '18 at 06:10
  • `PATH` not `NODE_PATH` – Samuel Toh Feb 21 '18 at 06:16
  • I try now when i run yo --version i don't have neither error nor the version – Pracede Feb 21 '18 at 07:10
  • Assuming you're on linux you can do a `which yo` to confirm that the machine is invoking the correct `yo` binary. It should be using the one you installed. Which is from `/Users/john/npm/bin/yo`. If it is using the right one then you are on the right track. – Samuel Toh Feb 22 '18 at 00:18