This method works only if you've installed Node via NVM through Homebrew on macOS.
-
Reboot your Mac into Recovery Mode by restarting your computer and holding down
Command+R
until the Apple logo appears on your screen. -
Click
Utilities > Terminal
. -
In the Terminal window, type in
csrutil disable
and press Enter. -
Restart your Mac.
-
Open the Terminal again.
-
In the Terminal window, type in
sudo ln -sf $NVM_BIN/node /usr/bin/node
, press Enter and type the password. -
The symlink to fix node was created, now the error must disappears.
-
For finish, repeat the steps 1 and 2, now on the Terminal window, type in
csrutil enable
and press Enter. -
Restart your Mac and enjoy!