List of Global NPM Packages with Versions

Let me start out by giving you the command to list all your globally installed npm packages:

npm list -g --depth=0

And now for the backstory:

The other day I was trying to install a JavaScript linter in VS Code. After looking through the extensions, I decided to use ESLint since it was the most popular. I downloaded and installed the extension, following the instructions to install ESLint globally using npm.

VS Code had to reload once it was installed and I recieved an error loading ESLint. The error said I was missing the eslint-react-plugin package.

Okay.

But I was just wanted ESLint for my JavaScript files. I relented and installed this new package globally. After restarting a third time, ESLint failed to load again because it needed yet ANOTHER package! I had enough. I went into VS Code extensions, uninstalled ESLint, and installed JSHint. It too needed me to install jshint through npm but then it started working immediately.

The only problem is that I had installed a number of packages for ESLint. I couldn’t remember the exact names at this point and my terminal history was erased from restarting VS Code.

I needed a listing of my globally installed npm packages. So I issued the command from the beginning of this article. This gave me a nice list of all my global npm packages along with their version. I finally issued an npm uninstall command on the ESLint packages and moved on with my life.

Maybe I will revisit ESLint one day if I start getting into React.

The npm list results look something like:

C:\Program Files\nodejs
+-- @angular/cli@7.2.2
+-- angular@1.7.5
+-- jshint@2.9.7
+-- json-server@0.14.2
+-- npm@6.4.1
+-- rxjs-tslint@0.1.6
+-- source-map-explorer@1.6.0
+-- tslint@5.12.0
`-- typescript@3.2.4

EDIT: After doing some ES2015 & ES6 coding using JSHint, I might have to switch over to ESLint. None of the new ECMAScript features are recognized by JSHint! 🤔

Published by Andrew

Full-stack developer. Systems Architect. Operator. Computer. End User. 💾

Leave a comment

Your email address will not be published. Required fields are marked *