为了账号安全,请及时绑定邮箱和手机立即绑定

刚进行到npm run build的时候提示要安装webpack-cli

刚进行到npm run build的时候提示要安装webpack-cli,不装进行不了。装好了以后再运行也报错

D:\Vue_program\vue-ssr-tech\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 (D:\Vue_program\vue-ssr-tech\node_modules\webpack\lib\cli.js:66:4)

    at addFlag (D:\Vue_program\vue-ssr-tech\node_modules\webpack\lib\cli.js:170:16)

    at traverse (D:\Vue_program\vue-ssr-tech\node_modules\webpack\lib\cli.js:243:21)

    at traverse (D:\Vue_program\vue-ssr-tech\node_modules\webpack\lib\cli.js:299:23)

    at traverse (D:\Vue_program\vue-ssr-tech\node_modules\webpack\lib\cli.js:248:24)

    at Object.getArguments (D:\Vue_program\vue-ssr-tech\node_modules\webpack\lib\cli.js:308:2)

    at Object.<anonymous> (D:\Vue_program\vue-ssr-tech\node_modules\webpack-cli\lib\utils\cli-flags.js:245:30)

    at Module._compile (D:\Vue_program\vue-ssr-tech\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)

    at Object.Module._extensions..js (module.js:663:10)

    at Module.load (module.js:565:32)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! vue-ssr-tech@1.0.0 build: `webpack --config webpack.config.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the vue-ssr-tech@1.0.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     D:\nodejs\node_cache\_logs\2020-12-09T03_57_27_871Z-debug.log


正在回答

2 回答

webpack-cli版本太高,降到3.几的版本就可以了

0 回复 有任何疑惑可以回复我~

已经安装了webpack-cli@4.2.0  webpack@5.10.0

依旧显示这个错误

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

刚进行到npm run build的时候提示要安装webpack-cli

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信