Executing packages directly with NPX
Since version 5.2.0, npm comes with a new tool called npx
, which allows us to execute packages without installing them globally. This is great for one-time commands.
Let’s say that we have a project with outdated dependencies, and we want to update them:
{ "dependencies": { "express": "^3.21.2", "lodash": "^1.3.1" }, "devDependencies": { "standard": "^17.1.0" } }
As we saw in the previous section, we can use the npm outdated
command to check which dependencies are outdated, but the upgrade process is a bit more complex as we need to upgrade each dependency manually or modify the package.json
directly.
Fortunately, there is a package called npm-check-updates (https://www.npmjs.com/package/npm-check-updates), which allows us to upgrade...