- You can do
yarn add my-packageto install the latest version of my-package - You can do
yarn add [email protected]to install v1.2.3
Can you specify a range, like in package.json?
yarn add my-package to install the latest version of my-packageyarn add [email protected] 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 package.json without the ^. E.g., yarn add express@^4.15.4 ends up with "express": "4.15.4";.yarn add "express@^4.15.4"