这是我的package.json。
{
"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"
}
}我用"npm安装webpack“安装了webpack,然后用"npm卸载”卸载了它,现在我的angular2服务器由于"WebpackOptionsValidationError“而无法启动。
到目前为止,我尝试过的是:
1)破坏node_modules文件夹并重新安装所有软件包2) git重置--很难(这显然不起作用,因为node_modules不在回购中) 3)再次下载回购并运行npm安装-保存,然后尝试启动服务器,这也不起作用。4)卸载我的系统上所有全局安装的节点包。
我完全不知所措。有什么想法吗?就好像webpack还在装着。:S
我像这样启动服务器:
ng serve --proxy proxy.conf.jsonWebpackOptionsValidationError: 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)发布于 2016-09-22 20:26:22
更新package.json使用角-cli 1.0.0-beta.15修复它。
https://stackoverflow.com/questions/39647506
复制相似问题