We also have two flags -save-dev and -save-exact - which we will explain in more detail in just a moment. That's major version 4, minor version 39, and patch 3. We specify a version with The version itself is 4.39.3.
#NPM INSTALL LATEST VERSION OF PACKAGE AND DEPENDENCIES HOW TO#
For now, we are just learning how to install packages with npm. We'll cover webpack itself further in the next lesson. Now we're ready to install our first package: webpack.
After all, if you were working at a tech company, you'd be expected to use the company's environment (which would likely be consistent across teams) instead of the other way around! Installing an npm Package While you are welcome to explore JavaScript packages further on your own, you are expected to use the pinned versions for independent projects. As stated in the last lesson, companies generally do not automatically upgrade to latest releases, especially if the version they are already using is reliable and they don't need any new features that more recent versions offer. Version pinning is commonly used throughout the industry. The latter is a recipe for breaking our code - and a very frustrating debugging situation. This is exactly what we were talking about in the last lesson! For that reason, it's more important to create a stable environment where all packages work together instead of a potentially chaotic environment where we are always installing the latest version of a package without fully testing whether it works with other packages we're using. When a package is updated, it won't necessarily play nicely with all the other packages in our environment.
Most of the packages we'll install specify a version of the package. We can install any npm package with the $ npm install command where is the package we want to install. We're now ready to start installing the packages we'll work with.