[GH-ISSUE #111] Windows support #79

Closed
opened 2026-03-03 16:04:16 +03:00 by kerem · 11 comments
Owner

Originally created by @naveenduttvyas on GitHub (Feb 10, 2018).
Original GitHub issue: https://github.com/mthenw/frontail/issues/111

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

Originally created by @naveenduttvyas on GitHub (Feb 10, 2018). Original GitHub issue: https://github.com/mthenw/frontail/issues/111 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
kerem 2026-03-03 16:04:16 +03:00
Author
Owner

@mthenw commented on GitHub (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.

<!-- gh-comment-id:432126723 --> @mthenw commented on GitHub (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.
Author
Owner

@KidSquid1 commented on GitHub (Feb 1, 2019):

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

<!-- gh-comment-id:459851769 --> @KidSquid1 commented on GitHub (Feb 1, 2019): 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
Author
Owner

@KidSquid1 commented on GitHub (Feb 1, 2019):

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/

<!-- gh-comment-id:459872999 --> @KidSquid1 commented on GitHub (Feb 1, 2019): > 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/
Author
Owner

@KidSquid1 commented on GitHub (Feb 1, 2019):

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

<!-- gh-comment-id:459890547 --> @KidSquid1 commented on GitHub (Feb 1, 2019): 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](https://user-images.githubusercontent.com/28264840/52153237-cff0bf80-263e-11e9-93af-bd0890d03109.png)
Author
Owner

@posipov34 commented on GitHub (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.

<!-- gh-comment-id:507237609 --> @posipov34 commented on GitHub (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.
Author
Owner

@KidSquid1 commented on GitHub (Jul 2, 2019):

@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!!!

<!-- gh-comment-id:507875230 --> @KidSquid1 commented on GitHub (Jul 2, 2019): @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!!!
Author
Owner

@upcdy commented on GitHub (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!

<!-- gh-comment-id:564832617 --> @upcdy commented on GitHub (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!
Author
Owner

@Steve-Mcl commented on GitHub (Jan 31, 2020):

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.

<!-- gh-comment-id:580828108 --> @Steve-Mcl commented on GitHub (Jan 31, 2020): 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.
Author
Owner

@mojoaxel commented on GitHub (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!

<!-- gh-comment-id:580888146 --> @mojoaxel commented on GitHub (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](https://github.com/mojoaxel/frontail/tree/windowsSupport) on windows if you need windows support!
Author
Owner

@mthenw commented on GitHub (Feb 2, 2020):

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

<!-- gh-comment-id:581173768 --> @mthenw commented on GitHub (Feb 2, 2020): I'm happy to merge those changes. @mojoaxel please open a new PR.
Author
Owner

@mthenw commented on GitHub (Feb 3, 2020):

I published v4.9.0 with Windows support

<!-- gh-comment-id:581389625 --> @mthenw commented on GitHub (Feb 3, 2020): I published v4.9.0 with Windows support
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/frontail#79
No description provided.