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

npm run build报错了,老师帮看下什么问题吧

过程是一步步按照视频走的。

hanyanshuo@hanyanshuodeMacBook-Pro learnTodoList $ npm run build

> learntodolist@1.0.0 build /Users/hanyanshuo/Desktop/learnTodoList

> webpack --config webpack.config.js


/Users/hanyanshuo/Desktop/learnTodoList/node_modules/webpack-cli/lib/webpack-cli.js:625

            const globalOptions = program.helpInformation().match(/Options:\n(?<globalOptions>.+)\nCommands:\n/s);

                                                                  ^


SyntaxError: Invalid regular expression flags

    at NativeCompileCache._moduleCompile (/Users/hanyanshuo/Desktop/learnTodoList/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)

    at Module._compile (/Users/hanyanshuo/Desktop/learnTodoList/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)

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

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

    at tryModuleLoad (module.js:497:12)

    at Function.Module._load (module.js:489:3)

    at Module.require (module.js:579:17)

    at require (/Users/hanyanshuo/Desktop/learnTodoList/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)

    at Object.<anonymous> (/Users/hanyanshuo/Desktop/learnTodoList/node_modules/webpack-cli/lib/bootstrap.js:1:82)

    at Module._compile (/Users/hanyanshuo/Desktop/learnTodoList/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! learntodolist@1.0.0 build: `webpack --config webpack.config.js`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the learntodolist@1.0.0 build script.

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

正在回答

2 回答

webpack-cli版本兼容问题吧,先卸载webpack-cli,换其他版本的webpack-cli试试

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

看这个提示好像是正则表达式出问题了?

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

举报

0/150
提交
取消
Vue+Webpack打造todo应用
  • 参与学习       84606    人
  • 解答问题       787    个

用前端最热门框架Vue+最火打包工具Webpack打造todo应用

进入课程

npm run build报错了,老师帮看下什么问题吧

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