安装npm
软件包时,我遇到了版本不匹配问题的对等依赖项。
错误 -
npm ERR! peerinvalid包webpack@2.1.0-beta.12没有 满足兄弟姐妹的同伴依赖要求! 错误的ERR! peerinvalid Peer babel-loader@6.2.4想要webpack @ 1 || ^ 2.1.0-β 错误的ERR! peerinvalid Peer karma-webpack@1.7.0想要webpack@^1.4.0 错误的ERR! peerinvalid Peer webpack-dev-server@2.0.0-beta想要webpack @> = 2.0.3-beta< 3
有没有人遇到这样的事情?
package.json文件
{
"private": true,
"dependencies": {
"todomvc-app-css": "2.0.4",
"todomvc-common": "1.0.2"
},
"devDependencies": {
"babel": "6.5.2",
"babel-core": "6.8.0",
"babel-eslint": "6.0.4",
"babel-loader": "6.2.4",
"babel-plugin-__coverage__": "1.11.111",
"babel-preset-es2015-webpack": "6.4.1",
"babel-preset-stage-2": "6.5.0",
"chai": "3.5.0",
"cpy-cli": "1.0.0",
"css-loader": "0.23.1",
"eslint": "2.9.0",
"eslint-config-kentcdodds": "6.2.1",
"eslint-loader": "1.3.0",
"ghooks": "1.2.1",
"istanbul": "0.4.3",
"karma": "0.13.22",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "1.0.1",
"karma-coverage": "1.0.0",
"karma-mocha": "1.0.1",
"karma-webpack": "1.7.0",
"mocha": "2.5.3",
"npm-run-all": "1.8.0",
"opt-cli": "1.4.2",
"rimraf": "2.5.2",
"style-loader": "0.13.1",
"webpack": "^2.0.0-beta",
"webpack-dev-server": "2.0.0-beta",
"webpack-validator": "2.1.2"
}
请准确说明我做错了什么?
答案 0 :(得分:0)
您的错误消息解释了所有内容:
您使用webpack 2
但karma-webpack
想要webpack 1
。你可以:
将webpack 2
降级为版本1
并将webpack-dev-server
降级为版本1
。
或
删除karma-webpack