  Let $\Sigma$ be an oriented compact hypersurface in the round sphere
$\mathbb{S}^n$ or in the flat torus $\mathbb{T}^n$, $n\geq 3$. In the case of
the torus, $\Sigma$ is further assumed to be contained in a contractible subset
of $\mathbb{T}^n$. We show that for any sufficiently large enough odd integer
$N$ there exists an eigenfunctions $\psi$ of the Laplacian on $\mathbb{S}^n$ or
$\mathbb{T}^n$ satisfying $\Delta \psi=-\lambda \psi$ (with $\lambda=N(N+n-1)$
or $N^2$ on $\mathbb{S}^n$ or $\mathbb{T}^n$, respectively), and with a
connected component of the nodal set of $\psi$ given by~$\Sigma$, up to an
ambient diffeomorphism.
