yarn add --save-exact

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

Also in Shell: