The prune command isn’t necessary. yarn install will prune extraneous packages.
yarn install
© 2016–present Yarn ContributorsLicensed under the BSD License. https://yarnpkg.com/en/docs/cli/prune