Dan Benjamin Dan Benjamin - 4 months ago 89
Node.js Question

NPM install peerinvalid - how to fix?

today my CircleCI stopped working due to a peer-invalid issue as can be seen below:

src/index.js -> lib/index.js
npm ERR! Linux 3.13.0-91-generic
npm ERR! argv "node" "/home/ubuntu/nvm/v0.10.33/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm v2.13.5
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@15.2.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer material-ui@0.15.2 wants react@^15.0.0
npm ERR! peerinvalid Peer react-addons-pure-render-mixin@15.2.1 wants react@^15.2.1
npm ERR! peerinvalid Peer react-flexbox@3.1.0 wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer react-tap-event-plugin@0.2.2 wants react@^0.14.0
npm ERR! peerinvalid Peer react-dom@15.2.1 wants react@^15.2.1

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/app/npm-debug.log


Below you can see my package.json file. Any idea on how to fix? How do I go about solving an issue like this? Whats the best approach?

{
"name": "XXXXX",
"version": "1.0.0",
"description": "",
"main": "all.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 0"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-eslint": "^4.1.3",
"babel-plugin-react-transform": "^1.1.1",
"browserify": "^11.0.1",
"browserify-incremental": "^3.0.1",
"eslint": "^1.5.1",
"eslint-config-airbnb": "0.0.8",
"eslint-plugin-react": "^3.4.2",
"react-a11y": "^0.2.6",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.1"
},
"dependencies": {
"babel-core": "^6.0.20",
"babel-loader": "^6.0.1",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.0.15",
"babel-preset-react": "^6.0.15",
"babel-preset-stage-2": "^6.0.15",
"babelify": "^6.3.0",
"chart.js": "^1.0.2",
"color": "^0.10.1",
"container-query": "0.0.2",
"es6-shim": "^0.27.1",
"history": "^1.12.5",
"immutable": "^3.7.5",
"jsx-control-statements": "^1.1.1",
"lodash": "^3.10.1",
"material-ui": "^0.13.0",
"moment": "^2.10.6",
"radium": "^0.14.2",
"react": "^0.14.2",
"react-addons-pure-render-mixin": "^0.14.2",
"react-flexbox": "^3.0.0",
"react-router": "1.0.0-rc3",
"react-tap-event-plugin": "^0.2.0",
"store-prototype": "^1.1.1"
}
}

Answer

Fixed and locked my npm and node versions

{
  "name": "XXXXX",
  "version": "1.0.0",
  "description": "",
  "main": "all.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 0"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-eslint": "^4.1.3",
    "babel-plugin-react-transform": "^1.1.1",
    "browserify": "^11.0.1",
    "browserify-incremental": "^3.0.1",
    "eslint": "^1.5.1",
    "eslint-config-airbnb": "0.0.8",
    "eslint-plugin-react": "~3.4.2",
    "react-a11y": "~0.2.6",
    "react-transform-catch-errors": "~1.0.0",
    "react-transform-hmr": "~1.0.1"
  },
  "dependencies": {
    "babel-core": "^6.0.20",
    "babel-loader": "^6.0.1",
    "babel-polyfill": "^6.3.14",
    "babel-preset-es2015": "^6.0.15",
    "babel-preset-react": "^6.0.15",
    "babel-preset-stage-2": "^6.0.15",
    "babelify": "^6.3.0",
    "chart.js": "^1.0.2",
    "color": "^0.10.1",
    "container-query": "0.0.2",
    "es6-shim": "^0.27.1",
    "history": "^1.12.5",
    "immutable": "^3.7.5",
    "jsx-control-statements": "^1.1.1",
    "lodash": "^3.10.1",
    "material-ui": "^0.13.0",
    "moment": "^2.10.6",
    "radium": "^0.14.2",
    "react": "~0.14.2",
    "react-addons-pure-render-mixin": "~0.14.2",
    "react-flexbox": "~3.0.0",
    "react-router": "1.0.0-rc3",
    "react-tap-event-plugin": "~0.2.0",
    "store-prototype": "^1.1.1"
  },
  "engines": {
    "node": "0.10.33",
    "npm": "2.1.35
  }
}
Comments