yarn add my-package
to install the latest version of my-packageyarn add my-package@1.2.3
to install v1.2.3Can you specify a range, like in package.json?
Yes.
I don't know why this isn't documented explicitly, but this works:
yarn add "express@^4.15.4"
# wrote "express": "^4.15.4" to package.json
# actually installed v4.17.1, which is latest satisfactory version