The geometric formulation of Hamilton--Jacobi theory for systems with nonholonomic constraints is developed, following the ideas of the authors in previous papers. The relation between the solutions of the Hamilton--Jacobi problem with the symplectic structure defined from the Lagrangian function and the constraints is studied. The concept of complete solutions and their relationship with constants of motion, are also studied in detail. Local expressions using quasivelocities are provided. As an example, the nonholonomic free particle is considered.