Here's a different proof of this statement that works over an arbitrary commutative unital integral domain $R$. One direction is rather uninspiring though, and the other direction reduces to the case over fields.
For our $n\times n$ matrix $A$ with entries in $R$, let $A^\alpha$ denote the classical adjoint of $A$. A nifty property of the classical adjoint is that $A^\alpha A = \det(A)I_n$. So if $A\mathbf{x}=0$ has a nonzero solution, we get that
$$
A\mathbf{x}=0
\quad\implies\quad
A^\alpha A\mathbf{x}=0
\quad\implies\quad
\det(A)I_n \mathbf{x}=0\,
$$
and since we have no zero divisors in $R$, $\det(A)$ cannot be a zero divisor and we must have $\det(A)=0$.
For the other direction, suppose that $\det(A)=0$. Let $\mathrm{Fr}(R)$ denote the field of fractions of $R$. Since $R$ is a domain, $\mathrm{Fr}(R)$ contains a copy of $R$ and we can think of the entries of $A$ as living in $\mathrm{Fr}(R)$. So since this result is true over fields, there $A\mathbf{x}=0$ has a nonzero solution
$$
\mathbf{x} = \left\langle \frac{a_1}{b_1}, \dotsc, \frac{a_n}{b_n} \right\rangle
$$
with $a_i,b_i \in R$. Let $\beta$ be the product $b_1\dotsb b_n$. Then since $\mathbf{x}$ is a solution to $A\mathbf{x}=0$, $\beta\mathbf{x}$ will be a solution too, and the entries of $\beta \mathbf{x}$ live $R$, giving us a nontrivial solution in $R$.
This theorem is not true though, if we aren't working over an integral domain