Yarn install | warning Pattern is trying to unpack in the same destination

Viewed 2716

I am new to Yarn the package manager. I am getting below error. Could someone help me?

 D:\test\0x-starter-project-master>yarn install
 yarn install v1.12.1
 [1/4] Resolving packages...
 [2/4] Fetching packages...
 warning Pattern ["ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git"] is trying to unpack in the same destination "C:\\Users\\abc\\AppData\\Local\\Yarn\\Cache\\v3\\npm-ethereumjs-abi-0.6.5-4ea2fdfed09e8f99117d9362d17c6b01b64a2bcf\\node_modules\\ethereumjs-abi" as pattern ["ethereumjs-abi@0.6.5","ethereumjs-abi@^0.6.5","ethereumjs-abi@0.6.5"]. This could result in non-deterministic behavior, skipping.
 [---------------------------------------------------------------------------------------------------------------] 0/884
2 Answers

It seems yarn can have problems figuring out dependencies sometimes. A workaround in this case is:

  1. Run yarn why <problem_package_name_here> to find all of the dependencies on that package. In your case, that would be yarn why ethereumjs-abi - keep a note of all of these dependent packages.

  2. Then yarn remove that package and all packages that are dependent on it.

  3. yarn add <problem_package_name_here> first (i.e. yarn add ethereumjs-abi in your case).

  4. And finally, yarn add <all> <the> <other> <packages> <you> <removed> <in> <step 2>

Now yarn should no longer be confused about dependencies etc.

I was experiencing a similar error using yarn to install the gulp-cli. This work-around solution worked for me: Use npm to install the module that yarn would not install.

Related