Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
To see the latest version of all the npm packages installed, including their dependencies:
npm list
Example:
❯ npm list
/Users/flavio/dev/node/cowsay
└─┬ [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└── [email protected]
You can also just open the package-lock.json file, but this involves some visual scanning.
npm list -g is the same, but for globally installed packages.
To get only your top-level packages (basically, the ones you told npm to install and you listed in the package.json), run npm list --depth=0:
❯ npm list --depth=0
/Users/flavio/dev/node/cowsay
└── [email protected]
You can get the version of a specific package by specifying the name:
❯ npm list cowsay
/Users/flavio/dev/node/cowsay
└── [email protected]
This also works for dependencies of packages you installed:
❯ npm list minimist
/Users/flavio/dev/node/cowsay
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]
To see the latest version available on the npm registry, run npm view <package_name> version:
❯ npm view cowsay version
1.3.1