mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add List The Installed Version Of A Specific Package as a pnpm TIL
This commit is contained in:
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||||
|
|
||||||
_1294 TILs and counting..._
|
_1295 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -590,6 +590,7 @@ _1294 TILs and counting..._
|
|||||||
|
|
||||||
- [Execute A Command From The Workspace Root](pnpm/execute-a-command-from-the-workspace-root.md)
|
- [Execute A Command From The Workspace Root](pnpm/execute-a-command-from-the-workspace-root.md)
|
||||||
- [Install Command Runs For Entire Workspace](pnpm/install-command-runs-for-entire-workspace.md)
|
- [Install Command Runs For Entire Workspace](pnpm/install-command-runs-for-entire-workspace.md)
|
||||||
|
- [List The Installed Version Of A Specific Package](pnpm/list-the-installed-version-of-a-specific-package.md)
|
||||||
|
|
||||||
### PostgreSQL
|
### PostgreSQL
|
||||||
|
|
||||||
|
|||||||
32
pnpm/list-the-installed-version-of-a-specific-package.md
Normal file
32
pnpm/list-the-installed-version-of-a-specific-package.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# List The Installed Version Of A Specific Package
|
||||||
|
|
||||||
|
`pnpm` is a Node-ecosystem package manager with first-class support for
|
||||||
|
monorepos. In a monorepo with many apps and packages that each have their own
|
||||||
|
`package.json` file, it can be tricky to know what version of a package is
|
||||||
|
installed for a specific app or package.
|
||||||
|
|
||||||
|
The `pnpm list` command can help with that. First navigate to a specific app or
|
||||||
|
package whose dependencies you want to know about. Then run a command like the
|
||||||
|
following, replacing `@trpc/next` with your package of interest.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ pnpm list '@trpc/next'
|
||||||
|
Legend: production dependency, optional only, dev only
|
||||||
|
|
||||||
|
epic-react /Users/jbranchaud/code/clients/egghead/products/apps/epic-react
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
@trpc/next 10.7.0
|
||||||
|
```
|
||||||
|
|
||||||
|
It tells you the exact version of that dependency that is isntalled for the
|
||||||
|
current app/package.
|
||||||
|
|
||||||
|
This command can also be used with regex. Let's say you want to know about all
|
||||||
|
`next`-related dependencies. You could do the following:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ pnpm list '*next*'
|
||||||
|
```
|
||||||
|
|
||||||
|
[source](https://pnpm.io/cli/list)
|
||||||
Reference in New Issue
Block a user