googlecreativelab / teachablemachine-community

Example code snippets and machine learning code for Teachable Machine
https://g.co/teachablemachine
Apache License 2.0
1.52k stars 686 forks source link

[BUG]: @tensorflow/tfjs Dependency error due to version mismatch #330

Open abhik-wil opened 1 year ago

abhik-wil commented 1 year ago

Describe the bug I am trying to use @tensorflow/tfjs and @teachablemachine/pose with a simple Vite app. While tfjs installs fine with npm i, I am getting the following dependency tree error on the latter:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: zeno-verify@0.0.0
npm ERR! Found: @tensorflow/tfjs@4.2.0
npm ERR! node_modules/@tensorflow/tfjs
npm ERR!   @tensorflow/tfjs@"^4.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @tensorflow/tfjs@"1.3.1" from @teachablemachine/pose@0.8.6
npm ERR! node_modules/@teachablemachine/pose
npm ERR!   @teachablemachine/pose@"*" 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.

PS: I am not sure where to raise the issue. Since I am following this Repo, I raised it here. Please redirect me to the correct repo if this is not the correct place.

To Reproduce

  1. Run npm create vite@latest.
  2. Go to the project folder and run npm i.
  3. Then run the following:
npm i @tensorflow/tfjs
npm i @teachablemachine/pose

Expected behavior The modules should install perfectly.

Additional context teachablemachine/pose install when using --force with npm i.

de24world commented 1 year ago

Similar issue.

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @teachablemachine/image@0.8.5 npm ERR! Found: @tensorflow/tfjs@4.2.0 npm ERR! node_modules/@tensorflow/tfjs npm ERR! dev @tensorflow/tfjs@"^4.2.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @tensorflow/tfjs@"1.3.1" from @teachablemachine/image@0.8.5 npm ERR! node_modules/@teachablemachine/image npm ERR! dev @teachablemachine/image@"^0.8.5" from the root project npm ERR! npm ERR! Conflicting peer dependency: @tensorflow/tfjs@1.3.1 npm ERR! node_modules/@tensorflow/tfjs npm ERR! peer @tensorflow/tfjs@"1.3.1" from @teachablemachine/image@0.8.5 npm ERR! node_modules/@teachablemachine/image npm ERR! dev @teachablemachine/image@"^0.8.5" 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.

MorningStarHu commented 1 year ago

me too

lionstigersandbears commented 1 year ago

me three

hamidrezafarzin commented 5 months ago

me four :D