

Pinning a package to an exact version carries the risk that the package will be dropped from the repo, and your Dockerfile will fail to build in the future. (At /packages, click "edge" and change it to the alpine image version you use, and click "search" again.)

Never pin packages from the "edge" branch of the alpine package repo, as these are in test and may be revoked. The package repository can be found here: In case you can't find a package, while you can see it in the UI for Alpine packages, update your sources/package database: apk update Install latest package version with the flag - npm install for reading and if you have any questions, use the comment function or send me a message you want to know more about Node, have a look at these Node Tutorials.You can set "sticky" versions like this: # Both are equal.Update individual packages with npm update.Check outdated packages with npm outdated.The NPM registry uses semantic versioning, and packages within the same major version shouldn't break anything, but the ecosystem has no way of enforcing this policy. Hence, don't just blindly update your packages without testing the application. The general rule in software development is Better safe than sorry. Important: Installing the latest version of a package puts the safeties provided by semantic versioning aside and can introduce major code changes into your project. For example, we have the following package.json (created with npm init -y and version 4.8.1 of lodash installed):Įnter fullscreen mode Exit fullscreen mode This command will output the current installed versions of all packages, the wanted version ( npm update would want to update to this version), and the latest available version. To check if any packages in your Node.js project are outdated, run npm outdated in the root folder (where the package.json file is). Update packages to a specific version or update packages to the latest major release.To update a dependency in a Node.js project you have to follow these steps: On a regular basis these records need to be updated to pull the latest compatible version. The package-lock.json is locking/pinning a specific version of a package. Keeping dependencies up-to-date is important, to get the latest security fixes, performance improvements, and general bug fixes for the packages installed.
