I know that $\varphi(p)=p-1$, so it rules out the primes. I then tried to consider all powers of primes. It then turn out that only $2^2=4$ works
If $$ n = pq\\ \varphi(n)=(p-1)(q-1)=pq-p-q+q=n-p-q+1\\ \rightarrow 1-p-q=-2 $$ which would't work since we want n to be positive I'm pretty stuck from here. I also tried to reason that $\varphi(n)=n\prod (1-\frac{1}{p_i})$ but couldn't get anywhere.
Thanks in advance for any help.
Assume $n$ has more than one prime factor. Let these prime factors be $p$, $q$. Since $p$ and $q$ and $n$ are not coprime with $n$, but $\phi(n)$ counts the number of numbers coprime to $n$, this implies $n-2=\phi(n)\le n-3$. Contradiction.
Thus, $n$ has one prime factor. So $n=p^{e}$ so some $p$ prime and $e$ natural. So $$p^{e}-2=n-2=\phi(n)=\phi(p^{e})=p^{e}-p^{e-1}$$ So $p^{e-1}=2$. By the Fundamental Theorem of Arithmetic, $p=2, e=2$,. So the only solution is $n=4$. We are done.