sudo rkhunter --check validates the PATH variable. This particular error can occur if you have an invalid directory declared. The sudo command will inherit the existing PATH variable set for the user.
First I’d suggest running
file /home/knoideclat/.local/bin/cmake. If it returns anything other than
directory, that’s likely the problem. The PATH variable should contain only directories.
echo $PATH, if
/home/knoideclat/.local/bin/cmake exists then you’ll want to find where this is being set (check
~/.profile, etc.) and either remove it or ensure that you only have a single path for
/home/knoideclat/.local/bin/. You can easily test the theory by running
PATH='/usr/local/sbin:/usr/local/bin:/usr/bin' sudo rkhunter --check