node.js - PM2 command not found -
i installed node.js , npm centos 7 server. have problems pm2. real problem don't have experiences in linux , don't know how change path. here folder structure.
* bin * code * error_docs * httpdocs * lib64 * logs * tmp * var * chat(my node.js folder) * node_modules * pm2 * sockjs * server.js * dev * etc * lib * local * sbin * usr
i entered folder typing cd chat
, installed pm2 npm install pm2
.
after tried use pm2 server.js typing pm2 server.js
server returns "pm2 command not found". can use node.js without problem pm2 not working.
how can solve this?
install pm2 globally:
run root:
npm -g pm2
or if user sudo-er
sudo npm -g pm2
and go user (or stay in root if created root user) , run it:
pm2 start server.js
Comments
Post a Comment