pm2-dev @ 1.1.1 fails with Cannot find module '../lib/Log'

Created on 6 Apr 2016  路  8Comments  路  Source: Unitech/pm2

Node: v5.10.0
PM2: 1.1.1

Console:
$ pm2-dev app.js

module.js:341
    throw err;
    ^

Error: Cannot find module '../lib/Log'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/bin/pm2-dev:10:17)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

~/.pm2/pm2.log

2014-05-26T23:39:53.925Z : Trace: [Error: todelete0 : id unknown]
    at Object.God.logAndGenerateError (/usr/local/share/npm/lib/node_modules/pm2/lib/God/Methods.js:26:15)
    at /usr/local/share/npm/lib/node_modules/pm2/lib/God/ActionMethods.js:211:30
    at Object.God.stopProcessId (/usr/local/share/npm/lib/node_modules/pm2/lib/God/ActionMethods.js:127:14)
    at Object.God.deleteProcessId (/usr/local/share/npm/lib/node_modules/pm2/lib/God/ActionMethods.js:210:9)
    at Worker.<anonymous> (/usr/local/share/npm/lib/node_modules/pm2/lib/God/Reload.js:121:13)
    at Worker.g (events.js:180:16)
    at Worker.EventEmitter.emit (events.js:95:17)
    at Object.messageHandler.listening (cluster.js:256:12)
    at handleMessage (cluster.js:197:32)
    at ChildProcess.EventEmitter.emit (events.js:117:20)

Works as intended @ 1.0.2

Most helpful comment

1.1.2 published

All 8 comments

pm2-dev needs a total rewrite

So...for those of us who are relatively new to NodeJS and PM2...I assume we're to use this as a workaround?

pm2 start server.js --watch

and:

pm2 logs

Which appears to work about the same as pm2-dev?

@brenc Yep, that's the easiest work around for now.

Don't forget to pm2 kill at the end - killing pm2 logs process still leaves the main service running.

Why release a new version of pm2 that breaks a core feature without warning? Perhaps in the pm2-dev script you should just console.log: This command is deprecated. since it just errors anyway.

This is really confusing, pls at least add some error message (like it was suggested: This command is deprecated.)

@petemill @alexshelkov A new version is just around the corner that will fix this, you can clone from GitHub right now if you're in a rush. We all make mistakes, obviously you've found this thread and the workarounds contained therein so no need to be so harsh on the hard working devs. :)

With FOSS software, you're always welcome to ask for your money back. Or submit a PR yourself...

1.1.2 published

@wulfsolter @Unitech no disrespect intended - I love pm2 and associated tools. Was just a suggestion that if the maintainers don't want to test/support pm2-dev that they could remove it, or propose someone else takes the lead on it, but I apologize for the tone that it obviously conveyed. Thanks for the fix and the response. I really appreciate it since I, personally, am a big pm2-dev user :-)

Was this page helpful?
0 / 5 - 0 ratings