![]() We wouldn’t want our package adding another completely different version of angular/core when someone adds it as a dependency to their Angular 6 application. However, some packages will cause conflicts when there are two different versions of them in the same code base.įor example, assume our component library was created using Angular 5. Sometimes, having two versions of the same package is fine. The idea is the same, but the syntax differs.As we saw from our experiment with npm version conflicts, if you add a package to your dependencies, there is a chance it may end up being duplicated in node_modules. With yarn, you can accomplish the same thing as follows: yarn add ![]() That will list all the versions from the first to the last one. If you want to see all the versions of a package, you can do it with the following command: npm view package_name versions When running the above command, npm installs the version specified after the symbol. ![]() The above commands install the latest version of the specified package.īut what if you want to install a specific version? The syntax for installing a particular package version is as follows: npm install _number Note: npm i is the shortcut for npm install. With npm, you install a package as follows: npm install package_name You will learn to do it using both yarn and npm. This article shows you how to install a specific package version to avoid such situations. One example would be when the latest changes in a package are not compatible with your code. But there are circumstances when you might need to install a specific package version. Usually, you install the latest version of a package when you want to use it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |