I try this solution but i keep the same problem.
yarn global add pm2
-> ok
sudo pm2 status
-> sudo: pm2: command not found
pm2 status
-> -bash: pm2: command not found
In my ~/.bashrc
i add the following line :
export PATH=$PATH:usr/bin/pm2
because whereis pm2
return /usr/bin/pm2
but nothing change
I test this path too : yarn bin
-> /home/user/node_modules/.bin
but nothing too