0

I am trying to install 'react-dnd' and getting:

+-- react-dnd@2.4.0 `-- UNMET PEER DEPENDENCY webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc

npm WARN babel-loader@6.4.1 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none was installed.

my project is using rollup and not webpack, i am not sure how to handle this. my npm version: 4.1.2 my package.json:

{
  "name": "newx",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^15.4.2",
    "react-dnd": "^2.4.0",
    "react-dnd-html5-backend": "^2.4.1",
    "react-dom": "^15.4.2",
    "react-redux": "^5.0.0",
    "redux": "^3.6.0"
  },
  "devDependencies": {
    "babel-core": "^6.25.0",
    "babel-plugin-external-helpers": "^6.22.0",
    "babel-plugin-transform-es2015-modules-commonjs": "^6.0.15",
    "babel-plugin-transform-react-constant-elements": "^6.0.14",
    "babel-plugin-transform-runtime": ">= 6.8.0",
    "babel-preset-env": "^1.2.2",
    "babel-preset-es2015": "^6.0.15",
    "babel-preset-react": "^6.0.15",
    "babel-preset-stage-2": "^6.24.1",
    "chalk": "^1.1.3",
    "express": "^4.15.2",
    "fs-extra": "^0.30.0",
    "minimatch": "^3.0.3",
    "mkdirp": "^0.5.1",
    "ncp": "^2.0.0",
    "node-getopt": "^0.2.3",
    "node-notifier": "^5.0.2",
    "node-sass": "^4.5.0",
    "prop-types": "^15.5.10",
    "rollup": "^0.41.6",
    "rollup-plugin-babel": "^2.7.1",
    "rollup-plugin-commonjs": "^8.0.2",
    "rollup-plugin-node-globals": "^1.1.0",
    "rollup-plugin-node-resolve": "^2.0.0",
    "rollup-plugin-replace": "^1.1.1",
    "rollup-plugin-uglify": "^1.0.1",
    "rollup-pluginutils": "^1.3.1",
    "uglify-js": "github:mishoo/UglifyJS2#harmony"
  },
  "scripts": {
    "build": "node scripts/rollup-watch.js",
    "build-release": "node scripts/rollup-watch.js --release --rebuild",
    "watch": "node scripts/rollup-watch.js --watch",
    "dev-server": "node scripts/dev-server.js"
  }
}

Can anyone help me clarify this ?

Amalin
  • 315
  • 4
  • 11

1 Answers1

0

You have this error because react-dnd use babel-loader. You can see it in the yarn.lock file of react-dnd.

And babel-loader use webpack as peer dependency

So simply : install webpack with npm install webpack

Troopers
  • 5,127
  • 1
  • 37
  • 64