datetime_5 2022-01-12 17:57 采纳率: 36.4%
浏览 121
已结题

报错 npm run dev webpack-dev-server --progress --config build/webpack.dev.conf.js



[webpack-cli] Invalid configuration object. Webpack has been initialized

``` using a configuration object that does not match the API schema.
 - configuration.devtool should match pattern "^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$".
   BREAKING CHANGE since webpack 5: The devtool option is more strict.
   Please strictly follow the order of the keywords in the pattern.
 - configuration.node should be one of these:
   false | object { __dirname?, __filename?, global? }
   -> Include polyfills or mocks for various node stuff.
   Details:
    * configuration.node has an unknown property 'setImmediate'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dgram'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'fs'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'net'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'tls'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'child_process'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.

```

  • 写回答

1条回答 默认 最新

  • 前端攻城师999 2022-01-13 15:15
    关注

    第一步:删除node_modules文件夹 rm -rf node_modules
    第二步:重新下载依赖 cnpm/npm install 项目之前使用的什么指令 你初始化就使用什么指令

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 10月6日
  • 修改了问题 1月12日
  • 创建了问题 1月12日