- I am using npm version 3 (version relevant because of the new way
peerDependencies
behave in version 3). - I have a reactjs app called "game" and a reactjs component called "player".
- I am using
webpack-dev-server
to run "game" app. react
andreact-dom
are dependencies ofgame
app andpeerDependencies
of theplayer
component.
I would like to link player
component to game
app.
I have done:
cd /player
npm link
cd /game
npm link player
When I run webpack-dev-server
program, I get the following error message:
Hash: 09968e7401389f50049f
Version: webpack 1.12.2
Time: 339ms
chunk {0} app.js, 0.14192ce06d8b6f8abb91.hot-update.js, app.css (app) 2.32 MB
+ 576 hidden modules
ERROR in ../player/index.js
Module not found: Error: Cannot resolve module 'react' in /player
@ ../player/index.js 21:13-29
How do I make player
component to use game
./node_modules
for the peerDependences
?