yarn add --save-exact

yarn add -D package
//or
yarn add --dev packageyarn add <package...> [--exact/-E]