12

After removing the older version of nvm, i installed the latest version of node by using homebrew. However, i got some problem starting my project using pm2:

pm2-dev server.js

It loaded the path including nvm. Here is the log:

Error: Cannot find module '/Users/wyb/.nvm/versions/io.js/v3.0.0/lib/node_modules/pm2/lib/ProcessContainerFork.js'

wyb
  • 123
  • 1
  • 4

2 Answers2

44

The reason is you pm2 env is modified, please try run command below to delete your pm2 env dir from your home dir.

rm -rf ~/.pm2

Now rerun your pm2-dev server.js, pm2 will refresh env.

Wtower
  • 18,848
  • 11
  • 103
  • 80
gongzili456
  • 556
  • 5
  • 4
3

@gongzili456

Answer is Good For Only if you host/deployed only 1 website in server

rm -rf ~/.pm2

but if you did host multiple website on same server then please Don't Use Above Command

Otherwise all website will be down and you can easily view

You Can Use This, if You did host multiple website in single server

pm2 update
shivam dwivedi
  • 80
  • 1
  • 11