howard
howard

Reputation: 254

Webpack is reporting the wrong version number ...?

When I run npm run webpack -v I get:

6.14.4

However when I look at the package.json file I can see it is:

"webpack": "^4.42.1",

Furthermore the current version I can find from the website is (09/01/2021):

5.51.1

Why is it reporting the wrong version number when I use the -v option?

Upvotes: 1

Views: 436

Answers (1)

Mario Varchmin
Mario Varchmin

Reputation: 3782

npm run webpack -v returns you the installed npm version, not the webpack version. With npm run you run a script (defined in package.json), but webpack is not a script.

You have to run npm exec webpack v or npx webpack v, which will display the correct version number(s).

Upvotes: 1

Related Questions