Search code examples
windowstensorflownpmnode-modulesnpm-install

Error installing "@tensorflow-models/face-landmarks-detection" npm package


I am encountering an issue while trying to install the "@tensorflow-models/face-landmarks-detection" npm package for face landmarks detection using TensorFlow. I have followed the installation instructions provided, but I keep running into an error. Here are the steps I've taken and the error message I'm receiving:

I ran the command npm install @tensorflow/tfjs @tensorflow-models/face-landmarks-detection. The installation started, but after a while, it failed with the following error message:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @tensorflow/[email protected]
npm ERR! node_modules/@tensorflow/tfjs-backend-webgl
npm ERR!   peer @tensorflow/tfjs-backend-webgl@"^4.4.0" from @tensorflow-models/[email protected]
npm ERR!   node_modules/@tensorflow-models/face-detection
npm ERR!     peer @tensorflow-models/face-detection@"~1.0.0" from @tensorflow-models/[email protected]
npm ERR!     node_modules/@tensorflow-models/face-landmarks-detection
npm ERR!       @tensorflow-models/face-landmarks-detection@"^1.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @tensorflow/tfjs-backend-webgl@"^3.12.0" from @tensorflow-models/[email protected]
npm ERR! node_modules/@tensorflow-models/face-landmarks-detection
npm ERR!   @tensorflow-models/face-landmarks-detection@"^1.0.2" 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!

I use NVM with using node 16.13.2 and NPM 9.6.7. I also tried reinstalling dependencies, but the error persists.

Can someone please guide me on how to resolve this issue? Any suggestions or insights would be greatly appreciated. Thank you!


Solution

  • NPM doesn't support conflicting version numbers of imported libraries. Use Yarn instead.