Which version of webpack will prevail?

the globally installed webpack is v4.12.1, the webpack referenced by the project package.json is v3.6.0 in the node_modules installed by dint install, and the version is 3.12.0. Which version is used when executing npm run build?

Jan.08,2022

use 3.12.0

compared to the overall situation, the module in the project will be preferred to be configured

configuration in the project "webpack": "4.8.0" will be subject to version 4.8.0, but generally speaking, we all write as "webpack": "^ 4.8.0", where ^ means to download the latest version of the current major version

.

so the configuration in your project should be "webpack": "^ 3.6.0" , so download it to version 3.12.0

.

you can take a look at nodeJS's module path resolution rules http://nqdeng.github.io/7-day.. Your situation depends on how your npm run build script is written. If it is node_modules/.bin/webpack, use the version in your node_modules. If it is webpcak, use your global version. If you have strict requirements for the version, you can refer to upstairs to limit the version

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7b9442-1efcf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7b9442-1efcf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?