node.js - react-router cannot resolve module history, missing lib folder -


i'm creating new react project , have dependency issue between react-router , history :

error in ./~/react-router/lib/match.js module not found: error: cannot resolve module 'history/lib/actions' in /app/node_modules/react-router/lib @ ./~/react-router/lib/match.js 15:15-45  error in ./~/react-router/lib/userouterhistory.js module not found: error: cannot resolve module 'history/lib/usequeries' in /app/node_modules/react-router/lib @ ./~/react-router/lib/userouterhistory.js 6:18-51  error in ./~/react-router/lib/creatememoryhistory.js module not found: error: cannot resolve module 'history/lib/usequeries' in /app/node_modules/react-router/lib @ ./~/react-router/lib/creatememoryhistory.js 6:18-51  error in ./~/react-router/lib/userouterhistory.js module not found: error: cannot resolve module 'history/lib/usebasename' in /app/node_modules/react-router/lib @ ./~/react-router/lib/userouterhistory.js 10:19-53  error in ./~/react-router/lib/creatememoryhistory.js module not found: error: cannot resolve module 'history/lib/usebasename' in /app/node_modules/react-router/lib @ ./~/react-router/lib/creatememoryhistory.js 10:19-53  error in ./~/react-router/lib/browserhistory.js module not found: error: cannot resolve module 'history/lib/createbrowserhistory' in /app/node_modules/react-router/lib @ ./~/react-router/lib/browserhistory.js 5:28-71  error in ./~/react-router/lib/hashhistory.js module not found: error: cannot resolve module 'history/lib/createhashhistory' in /app/node_modules/react-router/lib @ ./~/react-router/lib/hashhistory.js 5:25-65  error in ./~/react-router/lib/creatememoryhistory.js module not found: error: cannot resolve module 'history/lib/creatememoryhistory' in /app/node_modules/react-router/lib @ ./~/react-router/lib/creatememoryhistory.js 14:27-69 

i'm using react-router last release 3.0.0 has history 3.0.0 dependency in package.json. i'm using npm version 3.10.8 , if history module installed react-router dependency, added in package.json too, stated in react-router docs.

thing react-router searching requires in history/lib/ while history module has files in history/ (no lib folder).

since doesn't depend on configuration/installation on third parties modules, don't see , i'm surprised not find issue regarding this.

the problem follow react-router installation instructions, adding history module in our own package.json.

installing last version of history on own instead of 1 required react-router creating conflict.

with react-router >= 3.0, history dependency fixed version requirement, installed along react-router :

└─┬ react-router@3.0.0   └── history@3.2.1 

no need install manually in package.json, create conflicts if don't specify right required version.

thanks @shubhamkhatri having pointing me in direction.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -