'Error in /etc/nanorc in GIT for Windows, no /usr/share/nano

I got this error while using nano in Windows Terminal, with GIT-bash.

$ nano .bashrc
Error in /etc/nanorc on line 237: Error expanding /usr/share/nano/*.nanorc: No such file or directory


Solution 1:[1]

Got my answer here, that I will copy-paste here in case the content is lost:

$ git clone https://github.com/serialhex/nano-highlight
$ cd nano-highlight
$ cp * /usr/share/nano

Solution 2:[2]

run this command from git bash (as admin)

dos2unix /usr/share/nano/git.nanorc

It fixes line breaks, which are different in Linux and Windows.

from : https://www.scivision.dev/git-for-windows-nano-error-fix/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sylvain
Solution 2 Nikolai Zaitsev