webpack -v error solution

webpack -v error solution

background

I want to check the webpack version, but executing webpack -v reports an error

insert image description here

Solution

Step 1: Run the command npm list --depth=0 -g to check the compatibility of webpack, webpack-cli and other versions

insert image description here

For example, the above prompt means that you have installed [email protected], but your webpack version does not match (prompts that the version is too low). You need to install a version above v4.37.0, or directly install v5.0.0 (for example, directly install v4.37.0: npm install -g [email protected])

Step 2: Run the command npm list --depth=0 -g again to check

insert image description here

At this point, the detection has no errors, indicating that the webpack and webpack-cli versions have matched

Step 3: Execute webpack -v and still report an error

insert image description here

Run npm init -y to automatically configure package.json, then execute webpack -v to view the version normally.

insert image description here

Related links

webpack -v reports an error

Webpack builds Vue environment error

Mac node delete and reinstall

Webpack & Webpack-cli After successful installation, check webpack -v error

This is the end of this article about webpack -v error solution. For more relevant webpack -v error solution content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Summary of vue's webpack -v error solution
  • Electron-vue uses webpack to package multiple pages of entry files
  • After Webpack-cli is successfully installed, check the webpack -v error case for details

<<:  How to install Nginx in a specified location in Centos system

>>:  Implementing add, delete, modify and query operations on MySQL based on sqlalchemy

Recommend

SQL implementation of LeetCode (182. Duplicate mailboxes)

[LeetCode] 182.Duplicate Emails Write a SQL query...

What does href=# mean in a link?

Links to the current page. ------------------- Com...

How to use vue-cli to create a project and package it with webpack

1. Prepare the environment (download nodejs and s...

Solve the 1251 error when establishing a connection between mysql and navicat

I reinstalled the computer and installed the late...

Native js implementation of magnifying glass component

This article example shares the specific code for...

Mysql example of splitting into multiple rows and columns by specific symbols

Some fault code tables use the following design p...

Vue implements scroll loading table

Table of contents Achieve results Rolling load kn...

Implementation of k8s deployment of docker container

Environment: (docker, k8s cluster), continue with...

How to configure SSL certificate in nginx to implement https service

In the previous article, after using openssl to g...

The pitfall record of the rubber rebound effect of iOS WeChat H5 page

Business requirements One of the projects I have ...

A friendly alternative to find in Linux (fd command)

The fd command provides a simple and straightforw...

Linux remote login implementation tutorial analysis

Linux is generally used as a server, and the serv...