Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json resolutions is not respected for dependent packages #7682

Open
SteveShaffer opened this issue Nov 11, 2019 · 1 comment
Open

Comments

@SteveShaffer
Copy link

What is the current behavior?

The package.json resolutions section appears not to be respected for dependent packages or something like that. This is causing issues like justadudewhohacks/face-api.js#455 in repos that rely on older versions of packages that reportedly don't manifest when using npm to install dependencies (something I can't do though with a yarn monorepo).

Reproducible steps

  1. Create a project with this in its package.json:
{
  "name": "yarn-resolutions",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "face-api.js": "^0.21.0",
    "@tensorflow/tfjs-core": "1.2.9",
    "@tensorflow/tfjs-node": "1.2.9"
  },
  "resolutions": {
    "tfjs-image-recognition-base/@tensorflow/tfjs-core": "1.2.9"
  }
}
  1. Run yarn

What is the expected behavior?
In yarn.lock (and in the node_modules of the tfjs-image-recognition-base package) we see @tensorflow/tfjs-core is resolved to v1.2.9

Actual behavior
In yarn.lock (and in the node_modules of the tfjs-image-recognition-base package) we see @tensorflow/tfjs-core is resolved to v1.3.1 (per the dependency's package.json which says ~1.2.9)

Please mention your node.js, yarn and operating system version.
node: v12.13.0
yarn: 1.19.1
OS: macOS High Sierra 10.13.6

Workarounds
Manually editing yarn.lock to change the "@tensorflow/tfjs-core@^1.2.9": section to match the "@tensorflow/tfjs-core@1.2.9": section appears to fix the issue.

@bondar-pavel
Copy link

Is there any plans on fixing it?
I am affected by this issue and looks like many folks here as well: justadudewhohacks/face-api.js#455

Workaround works for me, so I end up with manually editing yarn.lock to fix the build each time something changes in package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants