TypeFox / monaco-languageclient

Repo hosts npm packages for monaco-languageclient, vscode-ws-jsonrpc, monaco-editor-wrapper, @typefox/monaco-editor-react and monaco-languageclient-examples
https://www.npmjs.com/package/monaco-languageclient
MIT License
1.04k stars 178 forks source link

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

Open shivam6543 opened 1 day ago

shivam6543 commented 1 day ago

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/monaco-vscode-editor-api@7.0.11"]. 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/monaco-vscode-api@7.0.11"]. 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 commented 1 day ago

@kaisalmen On further debugging this issue, I found out that mlc@8.7.0 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 commented 20 hours ago

@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.