Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lvgunst opened this issue Mar 23, 2016 · 2 comments
Closed

Comments

@lvgunst
Copy link
Contributor

lvgunst commented Mar 23, 2016

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
Copy link
Owner

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
Copy link
Contributor Author

lvgunst commented Mar 25, 2016

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!

@lvgunst lvgunst closed this as completed Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants