webpack 运行报错

来源:2-1 项目目录升级-一个正式项目的目录结构

香儿1314520

2019-05-07

修改分离webpack.config.base.js 和webpack.config.client.js 后,报错:

vue-todo@1.0.0 dev D:\web学习\vue项目搭建\vue-todo
cross-env NODE_ENV=development webpack-dev-server --config build/webpack.config.client.js

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration should be one of these:
    object | [object] | {
    “instanceof”: “Promise”,
    “description”: “A promise that resolves with a configuration object, or an array of configuration objects.”
    }
    Details:
    • configuration should be an object.
      -> A webpack configuration object.
    • configuration should be an array:
      [object]
      -> An array of webpack configuration objects.
    • configuration should be an instance of {
      “instanceof”: “Promise”,
      “description”: “A promise that resolves with a configuration object, or an array of configuration objects.”
      }
      -> A promise that resolves with a configuration object, or an array of configuration objects.
      Received: undefined : undefined
      npm ERR! code ELIFECYCLE
      npm ERR! errno 4294967295
      npm ERR! vue-todo@1.0.0 dev: cross-env NODE_ENV=development webpack-dev-server --config build/webpack.config.client.js
      npm ERR! Exit status 4294967295
      npm ERR!
      npm ERR! Failed at the vue-todo@1.0.0 dev 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! C:\Users\lenovo\AppData\Roaming\npm-cache_logs\2019-05-07T12_21_15_745Z-debug.log

写回答

1回答

lawlietee

2019-05-08

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

这句话的意思 webpack被一个不符合api范式的对象初始化。

configuration should be one of these: 配置文件 应该如这些种类

A promise that resolves with a configuration object, or an array of configuration objects.

如一个对象object,或者一个在object中的数组。


感觉你应该是哪里的括号写错了

0
1
香儿1314520
合并赋值后的config单词写错了
2019-05-08
共1条回复

Vue核心技术 Vue+Vue-Router+Vuex+SSR实战精讲

深入讲解Vue核心技术,展示Vue应用开发中的各种问题和解决方案

3168 学习 · 853 问题

查看课程