MrRio / vtop

Wow such top. So stats. More better than regular top.
http://parall.ax/vtop
MIT License
4.12k stars 149 forks source link

Error in vtop #125

Closed Sleedyak closed 6 years ago

Sleedyak commented 6 years ago

I've recently found about vtop, and from what I've seen it looked really cool. But after like 1 second of launching, the following error occured:


SyntaxError: Unexpected token ILLEGAL
    at Object.exports.runInNewContext (vm.js:48:16)
    at safeEval (/usr/local/lib/node_modules/vtop/node_modules/safe-eval/index.js:13:6)
    at /usr/local/lib/node_modules/vtop/upgrade.js:25:24
    at ChildProcess.exithandler (child_process.js:191:7)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:862:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)```
vhfmag commented 6 years ago

I've been stuck with that error for months now and almost abandoned vtop :disappointed:

But I've just found the issue: in upgrade.js, the shell command npm --color=false info vtop is ran and its output is fed into safe-eval, as it's expected that the npm-view output should be a JSON. But the behavior changed as of v8, and now, to get a JSON output, a --json flag must be given (e.g. npm --color=false info vtop --json).

The good news is that this should be an easy fix. I'll just examine v7 compatibility with the new json flag and probably land a PR.

vhfmag commented 6 years ago

Actually, that seems like a duplicate of #121 and the #123 PR should fix it. @Sleedyak, check out the vtop-node10 package published by @williamboman as a temporary fix.

MrRio commented 6 years ago

This is now fixed in v0.6.0. Thanks for your patience! :)