Webpack shows undefined when viewing the version

Solve the problem that webpack view version is showing undefined

1. First uninstall the previously installed webpack and webpack-cli

Perform all the following deletion steps just in case the deletion is not clean

1. Delete local (partial)

npm uninstall webpack-cli

2. Delete the global

npm uninstall -g webpack

3. Delete local

npm un webpack

2. Install global webpack

Command: npm install webpack -g

3. Install global wenpack-cli

Command: npm install webpack-cli -g

4. Check the webpack version

Command: webpack -v

Guess you like

Origin blog.csdn.net/qq_44255146/article/details/115246205