martinandert / react-translate-component

A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content.
MIT License
322 stars 31 forks source link

Dependencies are not installed automatically? #31

Closed rijk closed 7 years ago

rijk commented 7 years ago

When following the instructions from the quick-start tutorial, I get the following error:

$ npm install react-translate-component --save
translate@1.0.0 /Users/Rijk/Code/Playground/React/translate
├── UNMET PEER DEPENDENCY counterpart@^0.17.0
├── UNMET PEER DEPENDENCY react@^15.0.0
├── UNMET PEER DEPENDENCY react-interpolate-component@^0.10.0
└─┬ react-translate-component@0.13.2 
  └── object-assign@4.1.1 

npm WARN react-translate-component@0.13.2 requires a peer of react@^15.0.0 but none was installed.
npm WARN react-translate-component@0.13.2 requires a peer of counterpart@^0.17.0 but none was installed.
npm WARN react-translate-component@0.13.2 requires a peer of react-interpolate-component@^0.10.0 but none was installed.

Is this correct? Do I have to install them manually (the guide does not mention this)?

martinandert commented 7 years ago

Hi Rijk,

Yes, you have to install react, counterpart and react-interpolate-component manually.

The Readme is a bit outdated. Before npm v3, peer dependencies were auto-installed when installing a package, so the "This also installs React and Counterpart because these are configured as a peer dependencies." statement found in the tutorial made sense back then. As of npm v3, this is no longer the case, so peer dependencies have to be installed manually.

Thanks for pointing that out. I'll update the tutorial now.

rijk commented 7 years ago

Cool, thanks for explaining!