In this paper, we investigate the compactness of the commutator [C * ψ , Cϕ] on the Hardy space H 2 (BN ) or the weighted Bergman space A 2 s (BN ) (s > −1), when ϕ and ψ are automorphisms of the unit ball BN . We obtain that [C * ψ , Cϕ] is compact if and only if ϕ and ψ commute and they are both unitary. This generalizes the corresponding result in one variable. Moreover, our technique is different and simpler. In addition, we also discuss the commutator [C * ψ , Cϕ] on the Dirichlet space D(BN ), where ϕ and ψ are linear fractional self-maps or both automorphisms of BN .