Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support #111

Closed
naveenduttvyas opened this issue Feb 10, 2018 · 11 comments · Fixed by #194
Closed

Windows support #111

naveenduttvyas opened this issue Feb 10, 2018 · 11 comments · Fixed by #194

Comments

@naveenduttvyas
Copy link

installed uing npm command, and when executin below command, getting below error? how to make it work in windows?

frontail C:\Users\Test\Downloads\apache-samples\apache-error_log\error_log\syslog

Error received:

events.js:183
throw er; // Unhandled 'error' event
^

Error: spawn tail ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:686:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

@mthenw
Copy link
Owner

mthenw commented Oct 23, 2018

The reason for that is that frontail uses tail OS command which is not present on Windows. I have a plan to migrate to node implementation rather than rely on OS binary. I cannot guarantee the timeline for that change though.

@mthenw mthenw changed the title Not working in windows Windows support Oct 23, 2018
@KidSquid1
Copy link

So I'm wondering what magic this guy used to get it up and running on Windows Server 2012?

https://community.openhab.org/t/habpanel-reloaded-modern-theme-skin-custom-widgets/43883/66

@KidSquid1
Copy link

The reason for that is that frontail uses tail OS command which is not present on Windows

Maybe this was used?
https://www.windows-commandline.com/tail-command-for-windows/

@KidSquid1
Copy link

ok, I've installed the resource pack and added the folder to the windows system path and I now have access to TAIL which works as intended...yet I see nothing in the browser window. I can see the scrolling in the command box but nothing in the browser....see screen cap below.
tail

@posipov34
Copy link

posipov34 commented Jul 1, 2019

The problem contains in two parts:
First - the windows resorce pack command tail.exe support either -n or the -f option, but not both. So it it needed to change execution parameters in /lib/tail.js
Second - the bug in the index.js code:
const io = new SocketIO({ path: path.join(urlPath, '/socket.io') });
the path.join(urlPath, '/socket.io') on windows gives a "\\socket.io" string instead of "/socket.io" on linux.
this is the reason why the socket.io is not working.
const io = new SocketIO({ path: path.join(urlPath, '/socket.io').replace(/\\/g,"/") });
wil help.

@KidSquid1
Copy link

@posipov34

Thank You...Thank You....Thank You..

I made the following changes:

tail.js
Line 27 - if (process.platform === 'win32') {
I changed the platform to win32 from the linux flavor that was currently listed.

index.js
Line 77 - replaced the entire line with const io = new SocketIO({ path: path.join(urlPath, '/socket.io').replace(/\\/g,"/") });

Started up frontail and boom....I now have it working.....

Thanks again for the information!!!

mojoaxel added a commit to mojoaxel/frontail that referenced this issue Aug 3, 2019
mojoaxel added a commit to mojoaxel/frontail that referenced this issue Aug 3, 2019
mojoaxel added a commit to mojoaxel/frontail that referenced this issue Aug 3, 2019
mojoaxel added a commit to mojoaxel/frontail that referenced this issue Aug 3, 2019
mojoaxel added a commit to mojoaxel/frontail that referenced this issue Aug 3, 2019
mojoaxel added a commit to mojoaxel/frontail that referenced this issue Aug 3, 2019
@upcdy
Copy link

upcdy commented Dec 12, 2019

@KidSquid1 I tried to change the two file as your instruction and re run frontail c:\temp\syslog , but still got:
events.js:187
throw er; // Unhandled 'error' event
^

Error: spawn tail ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn tail',
path: 'tail',
spawnargs: [ '-n', 10, '-f', 'c:\temp\syslog' ]
}

is there any thing i can do? thanks!

@Steve-Mcl
Copy link

hi @mthenw , it looks like @mojoaxel did some great work in replacing native tail with nodejs version.

Have these modifications been merged into your repo?

I ask as I recently installed on windows server (from NPM) and I got same error that the other guys got & had to manually patch index.js and tail.js files & find a copy of tail for windows.

If your answer is yes, then perhaps NPM needs updating?

Cheers.

@mojoaxel
Copy link
Contributor

mojoaxel commented Jan 31, 2020

Have these modifications been merged into your repo?

Sadly the changes have not been merged (#175) but you can use my branch on windows if you need windows support!

mojoaxel added a commit to mojoaxel/frontail that referenced this issue Jan 31, 2020
@mthenw
Copy link
Owner

mthenw commented Feb 2, 2020

I'm happy to merge those changes. @mojoaxel please open a new PR.

mthenw pushed a commit that referenced this issue Feb 3, 2020
* fix: replace native tail with fs-tail-stream
fixes #111

* fix: use options.buffer as start parameter

* feat: add additional windows support

* feat: add additional windows support
@mthenw
Copy link
Owner

mthenw commented Feb 3, 2020

I published v4.9.0 with Windows support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants