Reputation: 1575
I'm building something with Webpack to transpile and bundle few JS files. However, I'd like to know which version I'm using.
Let's suppose that I have the it installed globally. How would I do it without checking package.json
?
Upvotes: 11
Views: 18188
Reputation: 22879
Run npm list --depth=0
and you will see a list of global modules with version listed. They're in alphabetical order so you should see webpack
at the very end. In my case it reads [email protected]
.
Upvotes: 7
Reputation: 1410
Due to my reputation, I am unable to comment. But quickly wanted to point out as suggested above in the right answer:
Alternate method:
npm view webpack version
will only show the latest webpack
that is available to download from the registry. It will not show the installed version.
(without dependencies)
For globally installed packages: npm list -g --depth=0
For locally installed packages: npm list --depth=0
(with dependencies)
For globally installed packages: npm list -g
For locally installed packages: npm list
Source: Find the version of an installed npm package
Upvotes: 23