How to determine the installed version of webpack

I am creating something using Webpack to overlap and merge multiple JS files. However, I would like to know which version I am using.

Suppose it is installed globally. How can I do this without checking package.json ?

+5
source share
2 answers

Due to my reputation, I cannot comment. But I quickly wanted to indicate, as suggested above, in the correct answer:

Alternative method:

npm view webpack version

only the last webpack that is available for download from the registry will be displayed. It will not show the installed version.

(no dependencies)

For public packages: npm list -g --depth=0

For locally installed packages: npm list --depth=0

(with dependencies)

For public packages: npm list -g

For locally installed packages: npm list

Source: Find the version of the installed npm package.

+6
source

Run npm list --depth=0 and you will see a list of global modules with the specified version. They are in alphabetical order, so you should see the webpack at the very end. In my case, he reads webpack-core@1.14.0 .

+4
source

Source: https://habr.com/ru/post/1263219/


All Articles