Unresolvable dependency for gix components

Hey,
I’m having trouble after…

  • creating a simple project using dfx new someapp
  • trying to add gix components using npm i @dfinity/gix-components

…I get the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: someapp_frontend@0.0.0
npm ERR! Found: @dfinity/agent@0.15.7
npm ERR! node_modules/@dfinity/agent
npm ERR!   @dfinity/agent@"^0.15.7" from someapp_frontend@0.0.0
npm ERR!   src/someapp_frontend
npm ERR!     someapp_frontend@0.0.0
npm ERR!     node_modules/someapp_frontend
npm ERR!       workspace src/someapp_frontend from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @dfinity/agent@"^1.2.1" from @dfinity/utils@2.2.0
npm ERR! node_modules/@dfinity/utils
npm ERR!   peer @dfinity/utils@"*" from @dfinity/gix-components@4.2.0
npm ERR!   node_modules/@dfinity/gix-components
npm ERR!     @dfinity/gix-components@"^4.2.0" from someapp_frontend@0.0.0
npm ERR!     src/someapp_frontend
npm ERR!       someapp_frontend@0.0.0
npm ERR!       node_modules/someapp_frontend

Is there any easy way for me to fix it or does it have to be on Dfinity’s side ?

Probably a noobish question, but I’d love some help. Maybe @peterparker? :blush:

Cheers !

1 Like

The incompatibility lies in your project according to the error message.

You are using @dfinity/agent@0.15.7 while @dfinity/gix-components requires @dfinity/utils@2.2.0 which requires @dfinity/agent@1.2.1.

=> 0.15.7 vs 1.2.1

You can try to either bump your agent-js dependency or try to force the npm install.

2 Likes