0

As example I will use pm2. I can't run the command pm2 on my nodenv nodejs installation. It will return:

$ pm2 -v
$ bash: pm2: command not found

further:

$ which pm2

does not return anything. What am I missing?

I installed it as the documentation suggested:

$ yarn global add pm2
mahatmanich
  • 10,791
  • 5
  • 63
  • 82

1 Answers1

3

Ok there are several pitfalls here:

  1. It looks like nodenv does not support yarn global package installations: Github issue from 2018, looks like it has not been implemented
  2. If you install a package with npm -g option you HAVE TO do nodenv rehash in order for the command to work in bash.
mahatmanich
  • 10,791
  • 5
  • 63
  • 82