How to use node in wsl - zsh: exec format error: node
22:12 05 Sep 2022

I am using windows 10 linux subsystem - linux 20.04. I have installed brew and using zsh (downloaded with brew).

The problem is when i have downloaded node with brew as well it does not work and shows me the following error:

zsh: exec format error: node

And when i am typing npm:

/home/linuxbrew/.linuxbrew/bin/node: 1: 0�: not found
/home/linuxbrew/.linuxbrew/bin/node: 1: �: not found
/home/linuxbrew/.linuxbrew/bin/node: 1: ����: not found
/home/linuxbrew/.linuxbrew/bin/node: 1: ʌ�,�/W�%r��@�:,2�F�: not found
/home/linuxbrew/.linuxbrew/bin/node: 1: ELF: not found
/home/linuxbrew/.linuxbrew/bin/node: 1:R�td0�0�E0�E�K�KP�P�EP�E: not found
/home/linuxbrew/.linuxbrew/bin/node: 2: K�/�q: not found
/home/linuxbrew/.linuxbrew/bin/node: 1: 
                                         �
: not found                               �0�0�E0�E�O�
/home/linuxbrew/.linuxbrew/bin/node: 10: Syntax error: ")" unexpected

Thanks for any kind of help :)

node.js homebrew zsh windows-subsystem-for-linux windows-terminal