ng服务破碎:webpack

时间:2017-03-06 00:36:40

标签: angular angular-cli

我用ng new创建了一个新的angular2应用程序,但是在服务上我得到了:

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

google了很多次并卸载/安装了几次违规套餐而没有结果。我想理解这一点,以解决它,而不是应用食谱。

ng版本

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.14
node: 7.4.0
os: darwin x64

npm list --depth = 0

UNMET PEER DEPENDENCY @angular/common@2.0.0
UNMET PEER DEPENDENCY @angular/compiler@2.0.0
UNMET PEER DEPENDENCY @angular/core@2.0.0
UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0

npm ERR! peer dep missing: @angular/common@2.4.9, required by @angular/platform-server@2.4.9
npm ERR! peer dep missing: @angular/compiler@2.0.2, required by @angular/compiler-cli@0.6.4
npm ERR! peer dep missing: @angular/compiler@2.4.9, required by @angular/platform-server@2.4.9
npm ERR! peer dep missing: @angular/core@2.0.2, required by @angular/compiler-cli@0.6.4
npm ERR! peer dep missing: @angular/core@2.4.9, required by @angular/platform-server@2.4.9
npm ERR! peer dep missing: @angular/platform-browser@2.4.9, required by @angular/platform-server@2.4.9
npm ERR! peer dep missing: @angular/platform-server@2.0.2, required by @angular/compiler-cli@0.6.4

我多次尝试手动取消/禁止/停止UNMEET PEER DEPENDENCY,没有任何改变。 我在当地:

├──webpack@2.2.0

├──webpack-dev-server@2.2.0

第一次使用npm,没有经验......任何建议欢迎

我跟着https://github.com/angular/angular-cli/issues/2234 给予

npm uninstall webpack --save-dev
npm install webpack@2.1.0-beta.22 --save-dev

现在我得到了

ng serve
** NG Live Development Server is running on http://localhost:4200. **
webpack.validateSchema is not a function
TypeError: webpack.validateSchema is not a function

和服务器停机

1 个答案:

答案 0 :(得分:1)

我建议在最近的angular-cli版本而不是1.0.0-beta.14上构建一个“新的”Angular 2应用。已经有RC版本。