skratchdot / react-bootstrap-multiselect

A multiselect component for react (with bootstrap). This is a react port of bootstrap-multiselect.
http://projects.skratchdot.com/react-bootstrap-multiselect/
Other
119 stars 61 forks source link

Failed updating react-bootstra-multiselect because of unmet react dependency #34

Closed lvgunst closed 8 years ago

lvgunst commented 8 years ago

I've React dependency in my package.json:

"react": "^0.14.7"

When I try to update react-bootstrap-multiselect I get unmet dependecy on React:

├── UNMET DEPENDENCY react@^0.14.7
└─┬ react-bootstrap-multiselect@1.0.2
  └── jquery@2.2.2

In your package.json you are using dependencies

"dependencies": {
  "jquery": ">=2.1.x",
  "react": ">=0.14.x"
},

React 0.14.7 should be valid for >=0.14.x but it doesn't look te be working.

When I run npm ls react I get:

├── UNMET DEPENDENCY react@^0.14.7
├─┬ react-bootstrap-daterangepicker@0.2.5
│ └── react@0.14.7
└─┬ react-bootstrap-multiselect@1.0.2
  └── react@0.14.7

npm ERR! missing: react@^0.14.7, required by my-project@1.0.0

Im using NPM 3 which uses a flat node_modules directory. After updating to react-bootstrap-multiselect@1.0.2 my node_modules/react-bootstrap-multiselect directory has it's own node_modules directory. My own node_modules/react has been removed.

node_modules/react-bootstrap-multiselect

When I try to build my application I get "Module not found: Error: Cannot resolve module 'react'". It won't use react from node_modules/react-bootstrap-multiselect/node_modules.

Im also using your react-bootstrap-daterangepicker which has the same dependencies but it's using peerDependecies for jquery and react. https://github.com/skratchdot/react-bootstrap-daterangepicker/blob/master/package.json#L22-L25

Do you know this problem and do you know if changing dependencies to peerDependencies in your module will fix this? Im happy to create a pull request.

Node v5.1.1 NPM 3.3.12

skratchdot commented 8 years ago

hmmm. That's odd. I have no idea why there's a nested node_modules in 1 or the dependencies. The first thing I'd try is rm -rf ./node_modules followed by a npm install. That way you are working fresh. Then see if there's still a node_modules/react-bootstrap-multiselect/node_modules folder (there shouldn't be). If you don't want to delete your whole node_modules folder, just try: rm -rf ./node_modules/react-bootstrap-multiselect/node_modules followed by npm install. Perhaps you got that nested folder by running npm install inside of the react-bootstrap-multiselect folder when you were working on a pull request or something?

I'm fine with moving the dependencies to peerDependencies in this project assuming it doesn't break things for people...

lvgunst commented 8 years ago

No I haven't run npm install inside of the react-bootstrap-multiselect folder. I forgot to mention Im using a npm-shrinkwrap.json file.

I have fixed it by removing my node_modules folder and updated the react-bootstrap-multiselect version in both my package.json and npm-shrinkwrap.json and run npm install. Very strange!