I'm getting the following for a locally installed package in Tester01 directory.
PS C:\Users\_\GitHub\Tester01> npm list
C:\Users\_\GitHub\Tester01
└── [email protected]
PS C:\Users\_\GitHub\Tester01> npm list -g
C:\Users\_\AppData\Roaming\npm
└── [email protected]
When I exit the directory where TypeScript is locally installed I get this.
PS C:\Users\_\GitHub\Tester01> cd..
PS C:\Users\_\GitHub> npm list
C:\Users\_\GitHub
└── (empty)
PS C:\Users\_\GitHub> npm list -g
C:\Users\_\AppData\Roaming\npm
└── [email protected]
If you only want to list the package that interests you (can't see the sane reason for that so I might be misunderstanding the question but still...) this is the syntax.
PS C:\Users\_\GitHub\Tester01> npm list -g [email protected]
C:\Users_\AppData\Roaming\npm
└── [email protected]
However, I've seen this answer but on my system (Win 10) it seems not to work. I've updated NPM to the latest version too (ver 3.10.8) to make sure but still get the error. I guess if you want to list them, you might use one of the following (although I don't like the syntax getting lengthy and I'm not certain on the details of what those are doing on a fundamental level).
PS C:\Users\_\GitHub\Tester01> npm list typescript --depth=0
C:\Users_\GitHub\Tester01
└── [email protected]
PS C:\Users\_\GitHub\Tester01> npm list install typescript
C:\Users\_\GitHub\Tester01
└── [email protected]