我一直没有满足rxjs
和zone.js
的对等依赖项。即使删除了node_modules
文件夹,也清理了npm缓存并重新安装了它。
我的 Node 版本是6.7.0,npm版本是3.10.8。
这是我的package.json:
{
"name": "bingel-teacher",
"version": "0.0.1",
"description": "Bingel project",
"main": "index.js",
"scripts": {
"postinstall": "typings install",
"start": "webpack-dev-server --config webpack/webpack.dev.js --inline --hot --host 0.0.0.0 --port 8080",
"build": "rimraf build && webpack --config webpack/webpack.build.js",
"test": "karma start",
"update": "npm install"
},
"author": "",
"license": "ISC",
"engines": {
"node": ">= 4.2.1",
"npm": ">= 3"
},
"devDependencies": {
"autoprefixer": "6.5.3",
"compression-webpack-plugin": "0.3.2",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.26.1",
"file-loader": "0.9.0",
"gulp-sass": "2.3.2",
"html-webpack-plugin": "2.24.1",
"imports-loader": "0.6.5",
"jasmine-core": "2.5.2",
"karma": "1.3.0",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
"karma-jasmine": "1.0.2",
"karma-phantomjs-launcher": "1.0.2",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "1.8.0",
"node-sass": "3.13.0",
"phantomjs-polyfill": "0.0.2",
"phantomjs-prebuilt": "2.1.13",
"postcss-loader": "1.2.0",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.8",
"rimraf": "2.5.4",
"sass-loader": "4.0.2",
"string-replace-webpack-plugin": "0.0.4",
"style-loader": "0.13.1",
"ts-loader": "1.3.1",
"tslint": "4.0.2",
"tslint-loader": "3.3.0",
"typescript": "2.1.4",
"typings": "2.0.0",
"url-loader": "0.5.7",
"webpack": "1.14.0",
"webpack-dev-server": "1.16.2",
"webpack-merge": "1.0.2"
},
"dependencies": {
"@angular/common": "2.3.0",
"@angular/compiler": "2.3.0",
"@angular/core": "2.3.0",
"@angular/forms": "2.3.0",
"@angular/http": "2.3.0",
"@angular/platform-browser": "2.3.0",
"@angular/platform-browser-dynamic": "2.3.0",
"@angular/router": "3.3.0",
"@ngrx/core": "1.2.0",
"@ngrx/store": "2.2.1",
"angular2-in-memory-web-api": "0.0.21",
"bootstrap": "3.3.7",
"bootstrap-sass": "3.3.7",
"core-js": "2.4.1",
"create-reducer-tree": "0.0.7",
"deep-freeze": "0.0.1",
"es6-promise": "4.0.5",
"es7-reflect-metadata": "1.6.0",
"exports-loader": "0.6.3",
"flatpickr": "2.2.4",
"font-awesome": "4.7.0",
"imports-loader": "0.6.5",
"jasmine": "2.5.2",
"jquery": "3.1.1",
"lodash": "4.17.2",
"mdi": "1.7.22",
"moment": "2.17.1",
"ng2-translate": "4.2.0",
"rxjs": "5.0.0-rc.4",
"snapsvg": "0.4.0",
"ts-helpers": "1.1.2",
"zone": "0.3.4",
"zone.js": "0.7.2"
}
}
预先感谢!
最佳答案
为了进行测试,我使用ng new
创建了一个新项目,删除了node_modules
,将package.json
替换为您提供的版本,然后运行了npm install
。
我立即重新创建了您的问题。
要解决这个问题:
npm update
这很好。解决对等依赖性问题的常规方法是简单地全部安装它们。例如:
npm install --save [email protected] [email protected]