问题
I see there are other questions regarding this warning from Yarn on Stack Overflow, but I can't find the answer to what it means -- I mean, what it really means. That is, what does it mean for me and my app, and how can I correct it?
I'm trying to add debug with Yarn, i.e. yarn add debug -D
and I get the warning
warning Pattern ["debug@^4.1.1"] is trying to unpack in the same destination "/Users/xyz/Library/Caches/Yarn/v4/npm-debug-4.1.1-3b72260255109c6b589cee050f1d516139664791/node_modules/debug" as pattern ["debug@^4.1.0","debug@^4.0.1"]. This could result in non-deterministic behavior, skipping.
I tried yarn remove debug
followed by yarn add debug -D
, but that didn't work.
Any insights and advice much appreciated!
回答1:
It means the installer usually creates the directory to install in, but in this case, it stumbled on a situation where the directory already exists. It is warning you that if it puts the files there, then the new files could co-exist with the files that were already there.
Try running:
rm -fR /Users/xyz/Library/Caches/Yarn/v4/npm-debug-4.1.1-3b72260255109c6b589cee050f1d516139664791/node_modules/debug
Then try installing again.
If that doesn't work, try running:
rm -fR /Users/xyz/Library/Caches/Yarn/v4/npm-debug-4.1.1-3b72260255109c6b589cee050f1d516139664791/node_modules
Then try installing again.
来源:https://stackoverflow.com/questions/54485533/what-does-yarn-really-mean-by-warning-pattern-debug4-1-1-is-trying-to-u