The recent discovery of superconductivity in infinite-layer nickelate films has aroused great interest since it provides a new platform to explore the mechanism of high-temperature superconductivity. However, superconductivity only appears in the thin film form and synthesizing superconducting nickelate films is extremely challenging, limiting the in-depth studies on this compound. Here, we explore the critical parameters in the growth of high quality nickelate films using molecular beam epitaxy (MBE). We found that stoichiometry is crucial in optimizing the crystalline structure and realizing superconductivity in nickelate films. In precursor NdNiO3 films, optimal stoichiometry of cations yields the most compact lattice while off-stoichiometry of cations causes obvious lattice expansion, influencing the subsequent topotactic reduction and the emergence of superconductivity in infinite-layer nickelates. Surprisingly, in-situ reflection high energy electron diffraction (RHEED) indicates that some impurity phases always appear once Sr ions are doped into NdNiO3 although the X-ray diffraction (XRD) data are of high quality. While these impurity phases do not seem to suppress the superconductivity, their impacts on the electronic and magnetic structure deserve further studies. Our work demonstrates and highlights the significance of cation stoichiometry in superconducting nickelate family.