2016-09-22 42 views
0

这是我的package.json。我安装了webpack并将其卸载,现在我的angular2应用程序不再启动

{ 
    "name": "app=thing", 
    "version": "0.0.0", 
    "engines": { 
    "node": "5.10.1", 
    "npm": "3.10.7" 
    }, 
    "license": "MIT", 
    "angular-cli": {}, 
    "scripts": { 
    "start": "ng serve", 
    "heroku-postbuild": "typings install && ng build", 
    "lint": "tslint \"src/**/*.ts\"", 
    "test": "ng test", 
    "pree2e": "webdriver-manager update", 
    "e2e": "protractor" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/common": "2.0.0", 
    "@angular/compiler": "2.0.0", 
    "@angular/core": "2.0.0", 
    "@angular/forms": "2.0.0", 
    "@angular/http": "2.0.0", 
    "@angular/platform-browser": "2.0.0", 
    "@angular/platform-browser-dynamic": "2.0.0", 
    "@angular/router": "3.0.0", 
    "core-js": "2.4.1", 
    "rxjs": "5.0.0-beta.12", 
    "ts-helpers": "1.1.1", 
    "zone.js": "0.6.23", 
    "@types/jasmine": "2.2.30", 
    "angular-cli": "1.0.0-beta.14", 
    "codelyzer": "~0.0.26", 
    "jasmine-core": "2.4.1", 
    "jasmine-spec-reporter": "2.5.0", 
    "karma": "1.2.0", 
    "karma-chrome-launcher": "2.0.0", 
    "karma-cli": "1.0.1", 
    "karma-jasmine": "1.0.2", 
    "karma-remap-istanbul": "0.2.1", 
    "protractor": "4.0.5", 
    "ts-node": "1.2.1", 
    "tslint": "3.13.0", 
    "typescript": "2.0.2", 
    "typings": "1.3.3" 
    }, 
    "devDependencies": { 
    "@types/jasmine": "^2.2.30" 
    } 
} 

我安装的WebPack使用“故宫安装的WebPack”,然后我卸载它使用“故宫卸载的WebPack”,我现在我的angular2服务器将无法启动,因为一个“WebpackOptionsValidationError”

这是我试过到目前为止:

1)干净利索node_modules文件夹并重新安装所有的包 2)的git的复位 - 硬(这显然是行不通的原因node_modules不在回购) 3)下再次加载repo并运行npm install --save,然后尝试启动服务器,但这也不起作用。 4)卸载我系统上全部安装的全部节点包。

我完全不知所措。有任何想法吗?这就像的WebPack仍莫名其妙地安装了...:S

我开始服务器这样的:

ng serve --proxy proxy.conf.json 

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. 
- configuration has an unknown property 'tslint'. These properties are valid: 
    object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? } 
    For typos: please correct them. 
    For loader options: webpack 2 no longer allows custom properties in configuration. 
    Loaders should be updated to allow passing options via loader options in module.rules. 
    Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader: 
    plugins: { 
     new webpack.LoaderOptionsPlugin({ 
     // test: /\.xxx$/, // may apply this only for some modules 
     options: { 
      tslint: ... 
     } 
     }) 
    } 
- configuration.module has an unknown property 'preLoaders'. These properties are valid: 
    object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? } 
    Options affecting the normal modules (`NormalModuleFactory`). 
- configuration.node.global should be a boolean. 
- configuration.resolve has an unknown property 'root'. These properties are valid: 
    object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache? } 
- configuration.resolve.extensions[0] should not be empty. 
    at webpack (/Users/dud/Work/app-thing/client/node_modules/webpack/lib/webpack.js:16:9) 
    at Class.exports.default.Task.extend.run (/Users/dud/Work/app-thing/client/node_modules/angular-cli/tasks/serve-webpack.js:23:27) 
    at /Users/dud/Work/app-thing/client/node_modules/angular-cli/commands/serve.js:84:26 
    at tryCatch (/Users/dud/Work/app-thing/client/node_modules/es6-promise/dist/lib/es6-promise/-internal.js:195:12) 
    at invokeCallback (/Users/dud/Work/app-thing/client/node_modules/es6-promise/dist/lib/es6-promise/-internal.js:210:13) 
    at publish (/Users/dud/Work/app-thing/client/node_modules/es6-promise/dist/lib/es6-promise/-internal.js:178:7) 
    at flush (/Users/dud/Work/app-thing/client/node_modules/es6-promise/dist/lib/es6-promise/asap.js:94:5) 
    at _combinedTickCallback (internal/process/next_tick.js:67:7) 
    at process._tickCallback (internal/process/next_tick.js:98:9) 
+0

你运行什么来启动应用程序? –

+0

'ng serve --proxy proxy.conf.json' – biodegabriel

+0

什么是'ng'命令? –

回答

1

更新的package.json使用角CLI 1.0。 0-beta.15修复了它。

相关问题