Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run globally installed node modules

I cannot get my Mac OS 10.8.5 to find the modules that npm installed globally. I am trying to execute bbb from the command line, but when I try to execute it, I get

   $ bbb
    -bash: bbb: command not found

I believe it is installed correctly:

  $ npm ls -g | grep bbb
    ├── [email protected]
    ├─┬ [email protected]
    ├─┬ [email protected]
    ├─┬ [email protected]
    ├─┬ [email protected]

Lots of people recommended putting /usr/local/share/npm/bin in their $PATH so I tried that:

$ env | grep PATH
PATH=/usr/local/bin:/usr/local/opt/ruby/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/local/opt/ruby/bin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
NODE_PATH=/usr/local/lib/node_modules

Does anyone have any other ideas with what can be going wrong? Thanks.

like image 437
jay Avatar asked Jan 27 '26 11:01

jay


1 Answers

If you look in bbb's package.json, it has no bin property, so you can't execute the command from the command line because it was not written to have command line functionality. Not all Node.js modules are created with use on the command line.

like image 132
hexacyanide Avatar answered Jan 29 '26 06:01

hexacyanide



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!