Cow Abunga Cow Abunga - 3 months ago 22
Node.js Question

Where are my globally installed packages?

I've installed TypeScript using the command below.

npm install -g typescript

The editor mentioned that it was too old so I used this guide to get the newest like this.

npm install -g typescript@next

No error messages, all seems great. But I wanted to verify what version I've got so I used this answer and executed the following.

npm list typescript

It said empty and also gave me an error. Then I tried to show all packages like this.

npm list

No error but nothing's listed. In still says empty. I executed the commands from PowerShell and I was both in a root directory and then also in the project's directory.

What am I missing? Probably something very stupid and basic.


With NPM, whenever you want to determine if something is installed locally or globally you need to specify that, just like you do when you're installing a package. By default, if you don't specify the global flag -g then npm will look within the current working directory.

npm list -g typescript