checking if there are dependencies or devDependencies before trying to tighten versions