After Webpack-cli is successfully installed, check the webpack -v error case for details

After Webpack-cli is successfully installed, check the webpack -v error case for details

question

1. Install webpack webpack-cli

npm install -g webpack webpack-cli

insert image description here

2. Check the webpack version

webpack -v

Report an error

/usr/local/lib/node_modules/webpack/lib/cli.js:66
                        .replace(
                        ^

SyntaxError: Invalid regular expression: /(\p{Uppercase_Letter}+|\p{Lowercase_Letter}|\d)(\p{Uppercase_Letter}+)/: Invalid escape
    at pathToArgumentName (/usr/local/lib/node_modules/webpack/lib/cli.js:66:4)
    at addFlag (/usr/local/lib/node_modules/webpack/lib/cli.js:170:16)
    at traverse (/usr/local/lib/node_modules/webpack/lib/cli.js:243:21)
    at traverse (/usr/local/lib/node_modules/webpack/lib/cli.js:299:23)
    at traverse (/usr/local/lib/node_modules/webpack/lib/cli.js:248:24)
    at Object.getArguments (/usr/local/lib/node_modules/webpack/lib/cli.js:308:2)
    at Object.<anonymous> (/usr/local/lib/node_modules/webpack-cli/lib/utils/cli-flags.js:245:30)
    at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)

solve

1. Check the node version

node -v
v9.11.2

It is found that the node version is not the latest. Download and install the latest version of Node (LTS) from the official website

node -v
v14.15.0

2. Upgrade npm

npm i -g npm

3. Check the webpack version

webpack -v

webpack-cli 4.2.0

webpack 5.4.0

This is the end of this article about checking webpack -v error cases after successful installation of Webpack-cli. For more related content about checking webpack -v error after successful installation of Webpack-cli, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • A brief discussion on source code analysis of webpack and webpack-cli modules
  • Summary of the role of webpack-cli in webpack packaging

<<:  Detailed tutorial on installing MySQL database in Linux environment

>>:  MySQL statement execution order and writing order example analysis

Recommend

How to Run a Command at a Specific Time in Linux

The other day I was using rsync to transfer a lar...

Detailed analysis of SQL execution steps

Detailed analysis of SQL execution steps Let'...

Example code for implementing page floating box based on JS

When the scroll bar is pulled down, the floating ...

Understanding the Lazy Loading Attribute Pattern in JavaScript

Traditionally, developers create properties in Ja...

The difference between JS pre-parsing and variable promotion in web interview

Table of contents What is pre-analysis? The diffe...

Using CSS to implement loading animation of Android system

There are two common loading icons on the web, on...

Installation tutorial of mysql 5.7 under CentOS 7

1. Download and install the official MySQL Yum Re...

HTML form tag tutorial (3): input tag

HTML form tag tutorial, this section mainly expla...

Methods and steps to upgrade MySql5.x to MySql8.x

Several Differences Between MySQL 5.x and MySQL 8...

In-depth exploration of whether Mysql fuzzy query is case-sensitive

Preface Recently, I have been busy writing a smal...

How to handle token expiration in WeChat Mini Programs

Table of contents Conclusion first question Solut...

Tomcat server security settings method

Tomcat is an HTTP server that is the official ref...

Detailed explanation of mysql.user user table in Mysql

MySQL is a multi-user managed database that can a...

Detailed explanation of the usage of the ESCAPE keyword in MySQL

MySQL escape Escape means the original semantics ...