-
带有^安装,这样可以跟随已经搭建的项目的package.json 中库版本相同,不用变动package.json
-
yarn add package@^1.0.0
-
npm install package@^1.0.0
yarn add package-1@1.2.3
yarn add package-2@^1.0.0
yarn add package-3@beta
{
"dependencies": {
"package-1": "1.2.3",
"package-2": "^1.0.0",
"package-3": "beta"
}
}