Hubs-Foundation / hubs-compose

Local development setup for Hubs
Mozilla Public License 2.0
45 stars 38 forks source link

NPM error #32

Closed dillfrescott closed 1 year ago

dillfrescott commented 1 year ago
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @mozilla/lilypad-ui@1.7.7
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   react@"^16.1.1" from the root project
npm ERR!   peer react@"^16.3.0" from @material-ui/core@1.5.1
npm ERR!   node_modules/@material-ui/core
npm ERR!     peer @material-ui/core@"^1.0.0" from @material-ui/icons@1.1.1
npm ERR!     node_modules/@material-ui/icons
npm ERR!       @material-ui/icons@"^1.0.0" from ra-ui-materialui@2.9.9
npm ERR!       node_modules/ra-ui-materialui
npm ERR!         ra-ui-materialui@"^2.9.9" from react-admin@2.9.9
npm ERR!         node_modules/react-admin
npm ERR!     peer @material-ui/core@"^1.0.0 || ^3.0.0" from material-ui-chip-input@1.0.0-beta.8
npm ERR!     node_modules/material-ui-chip-input
npm ERR!       material-ui-chip-input@"1.0.0-beta.6 - 1.0.0-beta.8" from ra-ui-materialui@2.9.9
npm ERR!       node_modules/ra-ui-materialui
npm ERR!         ra-ui-materialui@"^2.9.9" from react-admin@2.9.9
npm ERR!         node_modules/react-admin
npm ERR!     1 more (ra-ui-materialui)
npm ERR!   22 more (recompose, @material-ui/icons, material-ui-chip-input, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.1.0" from @mozilla/lilypad-ui@1.7.7
npm ERR! node_modules/@mozilla/lilypad-ui
npm ERR!   @mozilla/lilypad-ui@"^1.7.7" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@18.2.0
npm ERR! node_modules/react
npm ERR!   peer react@"^18.1.0" from @mozilla/lilypad-ui@1.7.7
npm ERR!   node_modules/@mozilla/lilypad-ui
npm ERR!     @mozilla/lilypad-ui@"^1.7.7" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-03-20T04_01_51_170Z-debug-0.log
bryanenders commented 1 year ago

This failure was introduced when the Lilypad package was added to Hubs Admin. Lilypad v1.7.7 depends on React v18, but it appears to work fine with React v16 in Hubs Admin. A correction to the peer dependencies in Lilypad is forthcoming. In the meantime you can patch bin/init as follows:

 echo -e ${prefix}Initializing Hubs Admin$suffix &&
-mutagen-compose -f "$composefile" run --rm hubs-admin npm install --no-save &&
+mutagen-compose -f "$composefile" run --rm hubs-admin npm install --force --no-save &&
 echo -e ${prefix}Initializing Hubs Client$suffix &&
dillfrescott commented 1 year ago

Okay. Thank you

bryanenders commented 1 year ago

This was fixed with https://github.com/mozilla/hubs/pull/6034 and improved with https://github.com/mozilla/hubs-compose/pull/35. Pull main and run $ bin/services-update, then you should be good to $ bin/init.