在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
问题1. 安装webpack webpack-cli
2. 查看webpack 版本
报错 /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) 解决1. 查看node版本node -v v9.11.2 发现node版本 不是最新的,官网下载安装最新版本的Node(LTS) node -v v14.15.0 2. 升级npmnpm i -g npm 3. 查看webpack版本webpack -v webpack-cli 4.2.0 webpack 5.4.0 到此这篇关于Webpack-cli安装成功后查看webpack -v报错案例详解的文章就介绍到这了,更多相关Webpack-cli安装成功后查看webpack -v报错内容请搜索极客世界以前的文章或继续浏览下面的相关文章希望大家以后多多支持极客世界! |
请发表评论