YF-S201 Water Flow Sensor - Help with Require

Further to @Steve-Mcl's suggestion, what does this command show?
npm list epoll

I see

tigger@1.0.0 /home/colinl/.node-red
└─┬ water-flow-sensor@1.0.1
  └─┬ onoff@1.2.0
    └── epoll@1.0.2 

which does suggest that they are correctly installed.

pi@raspberrypi:~/.node-red $ npm list epoll
node-red-project@0.0.1 /home/pi/.node-red
└─┬ water-flow-sensor@1.0.1
  └─┬ onoff@1.2.0
    └── epoll@1.0.2

The last line is orange colored.

I wonder if this is node version related?

What does node -v give you (what node -v are you using @colin)

Mine is v12.18.2

I am on 10, but also not on a pi, but that shouldn't make any difference. The actual error says it can't find libnode.so.64 which seems very odd.
I have a pi running node 12 I will try it on that.

Okay. I'll wait for that.

Also, if this doesn't work at all, I can use an Arduino to get the values and somehow communicate it with Node-Red. I saw a guy doing that with DS18B20. I couldn't even make an LED blink. It was too weird for me. Couldn't understand much about Firmata protocol.

That is odd, I can't install it on node 12. Did you update nodejs at some point possibly?

[Edit] Whatever the answer to that, run this and post the result please

npm remove water-flow-sensor
npm install water-flow-sensor

I got so many errors. I was using the built-in Node-Red at first. I must have downloaded it before I updated Node-Red. Without the update, there were no settings.js file. I had to update it.

I can't even post the terminal lines. Limit is 32 thousand characters, and with that, it reaches over 33 thousand characters.

At the end does it say it failed? If so then that corresponds to what I am seeing. It seems that it is not compatible with nodejs 12. I see that it has disappeared from github (as noted by @Steve-Mcl) so has he says this is probably a dead end.
Looking at the device it seems that all you need to do is to measure the rate that the pulses are coming in, and the rate is fairly low, so you can probably do it quite simply in node-red.

I have no idea how I can this kind of work without a package, or a node made by someone else. Yes, I just need the rate. If it is below a certain value, I will give a warning about it. Also, this value will be used with your PID node, to control a water pump. Can you help me get the flow rate?

Have you already worked out how to connect it to the Pi?
After connecting it then you should be able to use a GPIO In node to see the pulses. Get that working first.

I was on lunch break. I shut the Pi down before I left. Now, I got this on the Node-Red Terminal:

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.1.2:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
Error loading settings file: /home/pi/.node-red/settings.js
nodered.service: Succeeded.

This was filled with more errors and lines before I shut it down. Now, only this.

I am going to connect the sensor in a few minutes.

It is no use proceeding while still getting the setttings error. If you want to do it without the node then remove it and take your mod out of settings.js
npm remove water-flow-sensor

How are you connecting it? I see that it has a 5V output so you can't connect that direct to the GPIO pin without at least a voltage divider.

I have a setup ready for that. I'll delete the node. Deleted the line in settings.js too.

I connected it and saw 0 and 1 values keep changing rapidly as I blow into it the sensor. What can I do with this knowledge? Somehow capture the time it changes and make some calculations from that?

plenty of examples on that...
https://flows.nodered.org/search?term=counter

you should be able to adapt one of these flows / nodes to achieve a pulse count

This one might do the job, I have not used it but it appears you could configure it to give you a total count of messages every 5 seconds (or whatever) which you can then use to get the flow rate. Don't forget you will get two messages for each pulse (1 and 0) so you will get twice the message rate you would get if you were counting pulses. The datasheet tells you the flow for each pulse I think.

Another question. I wrote a function to compare temperature values. This function was connected to a trigger, and trigger was connected to a button. I learned that this part must be running at all times, without the button press. So, I put a timestamp before it. Now, I sometimes read values like these:

{ payload: 1595856943673, topic: "", _msgid: "661b8566.10c17c" }
7/27/2020, 4:35:47 PMnode: 7be3371.28d15c8
msg : Object
{ payload: 29, topic: "", _msgid: "8dfcb019.41d8a" }
7/27/2020, 4:35:51 PMnode: 7be3371.28d15c8
msg : Object
{ payload: 29, topic: "",

Now, it kept repeating reading that huge value for 10+ times. This is making the system use PID in a wrong way. How can I solve this? Should I just add a if statement where the value is below 50 or something, or is there a better way to run something all the time without any interaction from the user?

this is off topic & not enough detail to solve - you should start a new thread with appropriate title so others familiar with your issue can assist.

I read stuff like this when I debug msg.topic:

msg : string[24]
"Creating handler for all"
7/27/2020, 4:44:39 PMnode: 719343f1.236b2c
pi/37 : msg.topic : string[5]
"pi/37"
7/27/2020, 4:44:40 PMnode: 719343f1.236b2c
pi/37 : msg.topic : string[5]
"pi/37"

Edit: I checked msg.count, now I can see it.