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

Warning: package-name is trying to unpack in the same destination #747

Open
shivam6543 opened this issue Sep 20, 2024 · 8 comments
Open

Comments

@shivam6543
Copy link

Hello Team,

In my project, I’m using the following dependencies:

    "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~7.0.7",
    "monaco-languageclient": "~8.7.0",
    "vscode": "npm:@codingame/monaco-vscode-api@~7.0.7",
    "vscode-languageclient": "~9.0.1",
    "vscode-ws-jsonrpc": "~3.3.2"

but when I run yarn install it shows this warning in the terminal:


warning Pattern ["monaco-editor@npm:@codingame/monaco-vscode-editor-api@~7.0.7"] is trying to unpack in the same destination "/Users/hello/Library/Caches/Yarn/v6/npm-monaco-editor-7.0.11-3jaeh3jhj34j2324fk3b23g-integrity/node_modules/monaco-editor" as pattern ["monaco-editor@npm:@codingame/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["vscode@npm:@codingame/monaco-vscode-api@~7.0.7"] is trying to unpack in the same destination "/Users/hello/Library/Caches/Yarn/v6/npm-vscode-7.0.11-k2n3b1g2k5j6h1v3g5j6h4z8j1o9-integrity/node_modules/vscode" as pattern ["vscode@npm:@codingame/[email protected]"]. This could result in non-deterministic behavior, skipping.

I’m only installing v7.0.7 but some other package is also trying to install v7.0.11. I’m using yarn package manager to install dependencies.

I tried removing ~ from the packages versions but
still somehow it installs two versions. I also tried to run yarn cache clean —all before running yarn install.

Can you please help me how can I install only one version of the dependencies in my project. Thanks!

@shivam6543
Copy link
Author

shivam6543 commented Sep 20, 2024

@kaisalmen On further debugging this issue, I found out that [email protected] has monaco-editor@~7.0.7 and vscode@~7.0.7 as a direct dependency with ~. So, when I try to install mlc@~8.7.0 then it automatically upgrades the monaco-editor and vscode packages to the latest 7.0.x version as monaco-editor and vscode dependency has ~.

can we do something to prevent this issue? Is it ok to get that warning?

@kaisalmen
Copy link
Collaborator

kaisalmen commented Sep 21, 2024

@shivam6543 this is done intentionally ~ ensures that the latest patch versions are installed automatically. I don't know if yarn behaves correctly here. Do you already have lock file in place? Try yarn update to ensure all minor versions are updated to the same version.

@shivam6543
Copy link
Author

@kaisalmen Yes, I’ve yarn.lock file at the root of my project and I also tried running this command
yarn upgrade monaco-editor monaco-languageclient vscode vscode-languageclient vscode-ws-jsonrpc

And got this output:

Output:
success Saved lockfile.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
success Saved 8 new dependencies.
info Direct dependencies
├─ [email protected]
└─ [email protected]
info All dependencies
├─ @codingame/[email protected]
├─ @codingame/[email protected]
├─ @codingame/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
✨  Done in 27.99s.

From the output, it doesn’t seem like it upgraded the monaco-editor and vscode package version.

When I ran the above upgrade command, I got the same warning and after the command completion, it didn’t show any changes in the yarn.lock. Am I missing something?

@kaisalmen
Copy link
Collaborator

@shivam6543 is what yarn list helping to reveal where the different versions come from?

@shivam6543
Copy link
Author

@kaisalmen here is the output of the yarn list. From the output, it seems like mlc is installing the 7.0.7 but I’ve monaco-editor and vscode as a direct dependency because of that it’s trying to install 7.0.11. Any idea how to install only one version for all the packages?

├─ [email protected]
│  ├─ @codingame/monaco-vscode-extensions-service-override@~7.0.7
│  ├─ @codingame/monaco-vscode-languages-service-override@~7.0.7
│  ├─ @codingame/monaco-vscode-localization-service-override@~7.0.7
│  ├─ @codingame/monaco-vscode-model-service-override@~7.0.7
│  ├─ monaco-editor@npm:@codingame/monaco-vscode-editor-api@~7.0.7
│  ├─ vscode-languageclient@~9.0.1
│  └─ vscode@npm:@codingame/monaco-vscode-api@~7.0.7
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ @codingame/[email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ [email protected]
│  └─ vscode@npm:@codingame/[email protected]
├─ [email protected]
│  ├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]
│  ├─ @codingame/[email protected]

@kaisalmen
Copy link
Collaborator

kaisalmen commented Sep 27, 2024

@shivam6543 is possible that yarn @codingame/monaco-vscode-languages-service-override@~7.0.7 does not interpret this correctly. npm had some issues with this in the past if I remember correctly. Is it possible you try it with npm or pnpm. I need to see if I can reproduce it with yarn. Personally, I would not start a new project with yarn 1. But if that is not possible for whatever reason, we need to see if there is a solution or a workaround.

@shivam6543
Copy link
Author

shivam6543 commented Sep 29, 2024

@kaisalmen In my case, it’s not possible to use npm or pnpm. Please let us know if you find any solution or workaround for this issue.

@kaisalmen
Copy link
Collaborator

@shivam6543 don't know why I though about it earlier, but you can use yarn resolutions to enforce a specific version to circumvent such problems: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

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