Search code examples
node.jsbashyo

Can't find path to yo executable


So I can't run yo. I get

-bash: yo: command not found

when I type it. I know that I can just run it by setting the path in my bash_profile to my executable. My problem is I can't even find the path to yo.

I installed yo using

npm install -y -g yo 

and I got what's in the images below.

I believed it to be in the module

/usr/local/lib/node_modules/npm` 

That has a link called yo to

../lib/node_modules/yo/lib/cli.js

But when I type yo I still get the command not found error. I tried

sudo find / -name yo

and got the following directories:

enter image description here

But I tried in each of them and yo still won't run.

Question is where is the directory where I can type yo and it will run?

Below is result of installing yo

Jims-MacBook-Pro-2:~ jimstewart$ npm install -y -g yo
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/jimstewart/npm/bin/yo -> /Users/jimstewart/npm/lib/node_modules/yo/lib/cli.js
/Users/jimstewart/npm/bin/yo-complete -> /Users/jimstewart/npm/lib/node_modules/yo/lib/completion/index.js

> spawn-sync@1.0.15 postinstall /Users/jimstewart/npm/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall


> yo@1.8.5 postinstall /Users/jimstewart/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/jimstewart/npm/lib
└─┬ yo@1.8.5 
  ├── async@1.5.2 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├── has-ansi@2.0.0 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├── cli-list@0.1.8 
  ├─┬ configstore@1.4.0 
  │ ├── graceful-fs@4.1.11 
  │ ├─┬ mkdirp@0.5.1 
  │ │ └── minimist@0.0.8 
  │ ├── object-assign@4.1.1 
  │ ├── os-tmpdir@1.0.2 
  │ ├── osenv@0.1.4 
  │ ├── uuid@2.0.3 
  │ ├─┬ write-file-atomic@1.3.4 
  │ │ ├── imurmurhash@0.1.4 
  │ │ └── slide@1.1.6 
  │ └── xdg-basedir@2.0.0 
  ├─┬ cross-spawn@3.0.1 
  │ ├─┬ lru-cache@4.0.2 
  │ │ ├── pseudomap@1.0.2 
  │ │ └── yallist@2.1.2 
  │ └─┬ which@1.2.14 
  │   └── isexe@2.0.0 
  ├── figures@1.7.0 
  ├─┬ fullname@2.1.0 
  │ ├─┬ npmconf@2.1.2 
  │ │ ├─┬ config-chain@1.1.11 
  │ │ │ └── proto-list@1.2.4 
  │ │ ├── inherits@2.0.3 
  │ │ ├── ini@1.3.4 
  │ │ ├─┬ nopt@3.0.6 
  │ │ │ └── abbrev@1.1.0 
  │ │ ├─┬ once@1.3.3 
  │ │ │ └── wrappy@1.0.2 
  │ │ ├── semver@4.3.6 
  │ │ └── uid-number@0.0.5 
  │ ├── pify@2.3.0 
  │ └─┬ pinkie-promise@2.0.1 
  │   └── pinkie@2.0.4 
  ├─┬ got@5.7.1 
  │ ├─┬ create-error-class@3.0.2 
  │ │ └── capture-stack-trace@1.0.0 
  │ ├── duplexer2@0.1.4 
  │ ├── is-redirect@1.0.0 
  │ ├── is-retry-allowed@1.1.0 
  │ ├── is-stream@1.1.0 
  │ ├── lowercase-keys@1.0.0 
  │ ├── node-status-codes@1.0.0 
  │ ├─┬ parse-json@2.2.0 
  │ │ └─┬ error-ex@1.3.1 
  │ │   └── is-arrayish@0.2.1 
  │ ├── read-all-stream@3.1.0 
  │ ├─┬ readable-stream@2.2.9 
  │ │ ├── buffer-shims@1.0.0 
  │ │ ├── core-util-is@1.0.2 
  │ │ ├── isarray@1.0.0 
  │ │ ├── process-nextick-args@1.0.7 
  │ │ ├── string_decoder@1.0.1 
  │ │ └── util-deprecate@1.0.2 
  │ ├── timed-out@3.1.3 
  │ ├── unzip-response@1.0.2 
  │ └─┬ url-parse-lax@1.0.0 
  │   └── prepend-http@1.0.4 
  ├─┬ humanize-string@1.0.1 
  │ └── decamelize@1.2.0 
  ├─┬ inquirer@0.11.4 
  │ ├── ansi-escapes@1.4.0 
  │ ├── ansi-regex@2.1.1 
  │ ├─┬ cli-cursor@1.0.2 
  │ │ └─┬ restore-cursor@1.0.1 
  │ │   └── exit-hook@1.1.1 
  │ ├── cli-width@1.1.1 
  │ ├─┬ readline2@1.0.1 
  │ │ ├── code-point-at@1.1.0 
  │ │ ├── is-fullwidth-code-point@1.0.0 
  │ │ └── mute-stream@0.0.5 
  │ ├── run-async@0.1.0 
  │ ├── rx-lite@3.1.2 
  │ ├── string-width@1.0.2 
  │ └── through@2.3.8 
  ├─┬ insight@0.7.0 
  │ ├── inquirer@0.10.1 
  │ ├─┬ lodash.debounce@3.1.1 
  │ │ └── lodash._getnative@3.9.1 
  │ ├─┬ os-name@1.0.3 
  │ │ ├─┬ osx-release@1.1.0 
  │ │ │ └── minimist@1.2.0 
  │ │ └─┬ win-release@1.1.1 
  │ │   └── semver@5.3.0 
  │ ├─┬ request@2.81.0 
  │ │ ├── aws-sign2@0.6.0 
  │ │ ├── aws4@1.6.0 
  │ │ ├── caseless@0.12.0 
  │ │ ├─┬ combined-stream@1.0.5 
  │ │ │ └── delayed-stream@1.0.0 
  │ │ ├── extend@3.0.1 
  │ │ ├── forever-agent@0.6.1 
  │ │ ├─┬ form-data@2.1.4 
  │ │ │ └── asynckit@0.4.0 
  │ │ ├─┬ har-validator@4.2.1 
  │ │ │ ├─┬ ajv@4.11.8 
  │ │ │ │ ├── co@4.6.0 
  │ │ │ │ └─┬ json-stable-stringify@1.0.1 
  │ │ │ │   └── jsonify@0.0.0 
  │ │ │ └── har-schema@1.0.5 
  │ │ ├─┬ hawk@3.1.3 
  │ │ │ ├── boom@2.10.1 
  │ │ │ ├── cryptiles@2.0.5 
  │ │ │ ├── hoek@2.16.3 
  │ │ │ └── sntp@1.0.9 
  │ │ ├─┬ http-signature@1.1.1 
  │ │ │ ├── assert-plus@0.2.0 
  │ │ │ ├─┬ jsprim@1.4.0 
  │ │ │ │ ├── assert-plus@1.0.0 
  │ │ │ │ ├── extsprintf@1.0.2 
  │ │ │ │ ├── json-schema@0.2.3 
  │ │ │ │ └── verror@1.3.6 
  │ │ │ └─┬ sshpk@1.13.0 
  │ │ │   ├── asn1@0.2.3 
  │ │ │   ├── assert-plus@1.0.0 
  │ │ │   ├── bcrypt-pbkdf@1.0.1 
  │ │ │   ├─┬ dashdash@1.14.1 
  │ │ │   │ └── assert-plus@1.0.0 
  │ │ │   ├── ecc-jsbn@0.1.1 
  │ │ │   ├─┬ getpass@0.1.7 
  │ │ │   │ └── assert-plus@1.0.0 
  │ │ │   ├── jodid25519@1.0.2 
  │ │ │   ├── jsbn@0.1.1 
  │ │ │   └── tweetnacl@0.14.5 
  │ │ ├── is-typedarray@1.0.0 
  │ │ ├── isstream@0.1.2 
  │ │ ├── json-stringify-safe@5.0.1 
  │ │ ├─┬ mime-types@2.1.15 
  │ │ │ └── mime-db@1.27.0 
  │ │ ├── oauth-sign@0.8.2 
  │ │ ├── performance-now@0.2.0 
  │ │ ├── qs@6.4.0 
  │ │ ├── safe-buffer@5.0.1 
  │ │ ├── stringstream@0.0.5 
  │ │ ├── tunnel-agent@0.6.0 
  │ │ └── uuid@3.0.1 
  │ └─┬ tough-cookie@2.3.2 
  │   └── punycode@1.4.1 
  ├── lodash@3.10.1 
  ├─┬ meow@3.7.0 
  │ ├─┬ camelcase-keys@2.1.0 
  │ │ └── camelcase@2.1.1 
  │ ├─┬ loud-rejection@1.6.0 
  │ │ ├─┬ currently-unhandled@0.4.1 
  │ │ │ └── array-find-index@1.0.2 
  │ │ └── signal-exit@3.0.2 
  │ ├── map-obj@1.0.1 
  │ ├── minimist@1.2.0 
  │ ├─┬ normalize-package-data@2.3.8 
  │ │ ├── hosted-git-info@2.4.2 
  │ │ ├─┬ is-builtin-module@1.0.0 
  │ │ │ └── builtin-modules@1.1.1 
  │ │ └─┬ validate-npm-package-license@3.0.1 
  │ │   ├─┬ spdx-correct@1.0.2 
  │ │   │ └── spdx-license-ids@1.2.2 
  │ │   └── spdx-expression-parse@1.0.4 
  │ ├─┬ redent@1.0.0 
  │ │ ├── indent-string@2.1.0 
  │ │ └── strip-indent@1.0.1 
  │ └── trim-newlines@1.0.0 
  ├─┬ npm-keyword@4.2.0 
  │ └─┬ registry-url@3.1.0 
  │   └─┬ rc@1.2.1 
  │     ├── deep-extend@0.4.2 
  │     ├── minimist@1.2.0 
  │     └── strip-json-comments@2.0.1 
  ├── opn@3.0.3 
  ├─┬ package-json@2.4.0 
  │ ├── registry-auth-token@3.3.1 
  │ └── semver@5.3.0 
  ├─┬ parse-help@0.1.1 
  │ └─┬ execall@1.0.0 
  │   └─┬ clone-regexp@1.0.0 
  │     ├── is-regexp@1.0.0 
  │     └── is-supported-regexp-flag@1.0.0 
  ├─┬ read-pkg-up@1.0.1 
  │ ├─┬ find-up@1.1.2 
  │ │ └── path-exists@2.1.0 
  │ └─┬ read-pkg@1.1.0 
  │   ├─┬ load-json-file@1.1.0 
  │   │ └─┬ strip-bom@2.0.0 
  │   │   └── is-utf8@0.2.1 
  │   └── path-type@1.1.0 
  ├─┬ repeating@2.0.1 
  │ └─┬ is-finite@1.0.2 
  │   └── number-is-nan@1.0.1 
  ├─┬ root-check@1.0.0 
  │ ├─┬ downgrade-root@1.2.2 
  │ │ ├── default-uid@1.0.0 
  │ │ └── is-root@1.0.0 
  │ └─┬ sudo-block@1.2.0 
  │   └── is-docker@1.1.0 
  ├─┬ sort-on@1.3.0 
  │ ├── arrify@1.0.1 
  │ └─┬ dot-prop@2.4.0 
  │   └── is-obj@1.0.1 
  ├── string-length@1.0.1 
  ├─┬ tabtab@1.3.2 
  │ ├─┬ debug@2.6.8 
  │ │ └── ms@2.0.0 
  │ ├─┬ inquirer@1.2.3 
  │ │ ├── cli-width@2.1.0 
  │ │ ├─┬ external-editor@1.1.1 
  │ │ │ ├─┬ spawn-sync@1.0.15 
  │ │ │ │ ├─┬ concat-stream@1.6.0 
  │ │ │ │ │ └── typedarray@0.0.6 
  │ │ │ │ └── os-shim@0.1.3 
  │ │ │ └── tmp@0.0.29 
  │ │ ├── lodash@4.17.4 
  │ │ ├── mute-stream@0.0.6 
  │ │ ├─┬ run-async@2.3.0 
  │ │ │ └── is-promise@2.1.0 
  │ │ └── rx@4.1.0 
  │ ├── minimist@1.2.0 
  │ └─┬ npmlog@2.0.4 
  │   ├── ansi@0.3.1 
  │   ├─┬ are-we-there-yet@1.1.4 
  │   │ └── delegates@1.0.0 
  │   └─┬ gauge@1.2.7 
  │     ├── has-unicode@2.0.1 
  │     ├── lodash.pad@4.5.1 
  │     ├── lodash.padend@4.6.1 
  │     └── lodash.padstart@4.6.1 
  ├── titleize@1.0.0 
  ├─┬ update-notifier@0.6.3 
  │ ├─┬ boxen@0.3.1 
  │ │ ├── filled-array@1.1.0 
  │ │ └── widest-line@1.0.0 
  │ ├─┬ configstore@2.1.0 
  │ │ └── dot-prop@3.0.0 
  │ ├── is-npm@1.0.0 
  │ ├── latest-version@2.0.0 
  │ └─┬ semver-diff@2.1.0 
  │   └── semver@5.3.0 
  ├─┬ user-home@2.0.0 
  │ └── os-homedir@1.0.2 
  ├─┬ yeoman-character@1.1.0 
  │ └─┬ supports-color@3.2.3 
  │   └── has-flag@1.0.0 
  ├─┬ yeoman-doctor@2.1.0 
  │ ├─┬ bin-version-check@2.1.0 
  │ │ ├─┬ bin-version@1.0.4 
  │ │ │ └─┬ find-versions@1.2.1 
  │ │ │   └── semver-regex@1.0.0 
  │ │ ├── minimist@1.2.0 
  │ │ └─┬ semver-truncate@1.1.2 
  │ │   └── semver@5.3.0 
  │ ├─┬ each-async@1.1.1 
  │ │ ├── onetime@1.1.0 
  │ │ └── set-immediate-shim@1.0.1 
  │ ├── log-symbols@1.0.2 
  │ ├── object-values@1.0.0 
  │ ├── semver@5.3.0 
  │ └─┬ twig@0.8.9 
  │   ├─┬ minimatch@3.0.4 
  │   │ └─┬ brace-expansion@1.1.7 
  │   │   ├── balanced-match@0.4.2 
  │   │   └── concat-map@0.0.1 
  │   └─┬ walk@2.3.9 
  │     └── foreachasync@3.0.0 
  ├─┬ yeoman-environment@1.6.6 
  │ ├── diff@2.2.3 
  │ ├─┬ globby@4.1.0 
  │ │ ├─┬ array-union@1.0.2 
  │ │ │ └── array-uniq@1.0.3 
  │ │ └─┬ glob@6.0.4 
  │ │   ├── inflight@1.0.6 
  │ │   └── path-is-absolute@1.0.1 
  │ ├─┬ grouped-queue@0.3.3 
  │ │ └── lodash@4.17.4 
  │ ├─┬ inquirer@1.2.3 
  │ │ ├── cli-width@2.1.0 
  │ │ ├── mute-stream@0.0.6 
  │ │ └── run-async@2.3.0 
  │ ├── lodash@4.17.4 
  │ ├─┬ mem-fs@1.1.3 
  │ │ ├─┬ through2@2.0.3 
  │ │ │ └── xtend@4.0.1 
  │ │ ├─┬ vinyl@1.2.0 
  │ │ │ ├── clone@1.0.2 
  │ │ │ ├── clone-stats@0.0.1 
  │ │ │ └── replace-ext@0.0.1 
  │ │ └─┬ vinyl-file@2.0.0 
  │ │   └─┬ strip-bom-stream@2.0.0 
  │ │     └── first-chunk-stream@2.0.0 
  │ ├── text-table@0.2.0 
  │ └── untildify@2.1.0 
  └─┬ yosay@1.2.1 
    ├── cli-boxes@1.0.0 
    ├── pad-component@0.0.1 
    ├─┬ taketalk@1.0.0 
    │ ├── get-stdin@4.0.1 
    │ └── minimist@1.2.0 
    └── wrap-ansi@2.1.0 

Solution

  • The shell will not look for executable in current working directory by default.

    To allow just add . to PATH :

    PATH=$PATH:.