hangxingliu / vscode-coding-tracker

:clock10: A coding activities tracker(time, file, type)
GNU General Public License v3.0
171 stars 34 forks source link

ENOENT - Visual-studio-code-insiders #23

Closed Its-Alex closed 6 years ago

Its-Alex commented 6 years ago

I run this extension with visual studio code insiders, and I have this error

[Launch]: Local server launching...
[Error]: start local server failed!
Error: spawn node ENOENT
    at exports._errnoException (util.js:1050:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
[Error]: local server exit with code -2!(have you launch another local sever?)
[Exit] exit code: -2

This could be because extensions directory is ~/.vscode-insiders instead of ~/.vscode ?

hangxingliu commented 6 years ago

It seems like you have not install Node.js.
Because extension launch a server written by Node.js in local server mode.

https://nodejs.org


And I will fix this error in the next version (replace spawn to fork)

Its-Alex commented 6 years ago

~I have installed nodejs, I use nvm, can be due to this ?~

This is because of nvm thanks

hangxingliu commented 6 years ago

Lol, yes. Because nvm initialize node npm npx after terminal start .bashrc.

And you can wait a moment, I will comment a temporary solve codes in here later.

And what operation system you are using now?

hangxingliu commented 6 years ago

If you want keep your nvm environment. you can change some place in the extension sources:

Directory:
$HOME/.vscode-insiders/hangxingliu.vscode-coding-tracker-xxx/

File:
lib/LocalServer.js

Line 35:

{ fork, spawn, exec } = require('child_process'),

Line 112:

var s = fork(EXECUTE_PARAMETERS[0], _getLaunchParameters().slice(1), { cwd: EXECUTE_CWD, silent: true });

And I will commit this patch to thr repository later

Its-Alex commented 6 years ago

Thanks ! I will try this