-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Could not find a copy of {pkg.name} to link in {location} #6285
Comments
I'm also running into this - started happening randomly today (not related to upgrading yarn. previous Tried wiping the yarn cache manually to no avail |
I have this error pretty often. I use workspaces and have used I notice that sometimes I have to re-link the package because it got unlinked. Part of the log: yarn-error.logArguments:
/usr/local/bin/node /Users/brunolemos/.yarn/bin/yarn.js add apollo-server graphql
PATH:
/Users/brunolemos/.rbenv/shims:/Users/brunolemos/.rbenv/bin:/Users/brunolemos/.fastlane/bin:/Users/brunolemos/.yarn/bin:/Users/brunolemos/.config/yarn/global/node_modules/.bin:/usr/local/bin/mongo/bin:/usr/local/bin:/Users/brunolemos/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/brunolemos/Library/Android/sdk//bin:/Users/brunolemos/Library/Android/sdk/platform-tools/
Yarn version:
1.10.1
Node version:
8.11.4
Platform:
darwin x64
Trace:
Invariant Violation: could not find a copy of eslint to link in /Users/brunolemos/Projects/workstories/node_modules/web/node_modules/react-scripts/node_modules
at invariant (/Users/brunolemos/.yarn/lib/cli.js:1736:15)
at PackageLinker.<anonymous> (/Users/brunolemos/.yarn/lib/cli.js:45555:7)
at Generator.next (<anonymous>)
at step (/Users/brunolemos/.yarn/lib/cli.js:98:30)
at /Users/brunolemos/.yarn/lib/cli.js:109:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
npm manifest:
{
"name": "server",
"version": "0.0.1",
"dependencies": {
"shared": "0.0.1"
}
}
yarn manifest:
No manifest
Lockfile:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/[email protected]", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.35":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8"
integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==
dependencies:
"@babel/highlight" "^7.0.0"
"@babel/[email protected]":
version "7.0.0-beta.44"
resolved "http://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9"
integrity sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==
dependencies:
"@babel/highlight" "7.0.0-beta.44"
"@babel/[email protected]":
version "7.0.0-beta.47"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.47.tgz#d18c2f4c4ba8d093a2bcfab5616593bfe2441a27"
integrity sha512-W7IeG4MoVf4oUvWfHUx9VG9if3E0xSUDf1urrnNYtC2ow1dz2ptvQ6YsJfyVXDuPTFXz66jkHhzMW7a5Eld7TA==
dependencies:
"@babel/highlight" "7.0.0-beta.47"
"@babel/[email protected]":
version "7.0.0-beta.47"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.47.tgz#b9c164fb9a1e1083f067c236a9da1d7a7d759271"
integrity sha512-7EIuAX0UVnCgZ0E9tz9rFK0gd+aovwMA9bul+dnkmBQYLrJdas2EHMUSmaK67i1cyZpvgVvXhHtXJxC7wo3rlQ==
dependencies:
"@babel/code-frame" "7.0.0-beta.47"
"@babel/generator" "7.0.0-beta.47"
"@babel/helpers" "7.0.0-beta.47"
"@babel/template" "7.0.0-beta.47"
"@babel/traverse" "7.0.0-beta.47"
"@babel/types" "7.0.0-beta.47"
babylon "7.0.0-beta.47"
convert-source-map "^1.1.0"
debug "^3.1.0"
json5 "^0.5.0"
lodash "^4.17.5"
micromatch "^2.3.11"
resolve "^1.3.2"
semver "^5.4.1"
source-map "^0.5.0"
"@babel/[email protected]", "@babel/core@^7.0.1", "@babel/core@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.0.tgz#08958f1371179f62df6966d8a614003d11faeb04"
integrity sha512-9EWmD0cQAbcXSc+31RIoYgEHx3KQ2CCSMDBhnXrShWvo45TMw+3/55KVxlhkG53kw9tl87DqINgHDgFVhZJV/Q==
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/generator" "^7.0.0"
"@babel/helpers" "^7.1.0"
"@babel/parser" "^7.1.0"
"@babel/template" "^7.1.0"
"@babel/traverse" "^7.1.0"
"@babel/types" "^7.0.0"
convert-source-map "^1.1.0"
debug "^3.1.0"
json5 "^0.5.0"
lodash "^4.17.10"
resolve "^1.3.2"
semver "^5.4.1"
source-map "^0.5.0"
[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-2.0.0.tgz#baed13bd7e1592f6df8fb19a186671cdb0a92018"
integrity sha512-lZNltuWfgD44Z+pyMU9iiZiuYhF1zJvXmFnuI5tKwgGuy7NuQpdD/fiO1UEO4VgtHZwFO84VvQoZGGnbm+8+2w==
dependencies:
"@babel/core" "7.1.0"
"@babel/runtime" "7.0.0"
"@svgr/webpack" "2.4.1"
babel-core "7.0.0-bridge.0"
babel-eslint "9.0.0"
babel-jest "23.6.0"
babel-loader "8.0.2"
babel-plugin-named-asset-import "^0.2.0"
babel-preset-react-app "^4.0.0"
bfj "6.1.1"
case-sensitive-paths-webpack-plugin "2.1.2"
chalk "2.4.1"
css-loader "1.0.0"
dotenv "6.0.0"
dotenv-expand "4.2.0"
eslint "5.6.0"
eslint-config-react-app "^3.0.0"
eslint-loader "2.1.1"
eslint-plugin-flowtype "2.50.1"
eslint-plugin-import "2.14.0"
eslint-plugin-jsx-a11y "6.1.1"
eslint-plugin-react "7.11.1"
file-loader "2.0.0"
fs-extra "7.0.0"
html-webpack-plugin "4.0.0-alpha.2"
identity-obj-proxy "3.0.0"
jest "23.6.0"
loader-utils "1.1.0"
mini-css-extract-plugin "0.4.3"
optimize-css-assets-webpack-plugin "5.0.1"
postcss-flexbugs-fixes "4.1.0"
postcss-loader "3.0.0"
postcss-preset-env "6.0.6"
postcss-safe-parser "4.0.1"
react-app-polyfill "^0.1.0"
react-dev-utils "^6.0.0"
resolve "1.8.1"
sass-loader "7.1.0"
style-loader "0.23.0"
sw-precache-webpack-plugin "0.11.5"
terser-webpack-plugin "1.1.0"
thread-loader "1.2.0"
url-loader "1.1.1"
webpack "4.19.1"
webpack-dev-server "3.1.9"
webpack-manifest-plugin "2.0.4"
optionalDependencies:
fsevents "1.2.4" |
I'm seeing this also. I believe it has to do with peer-dependencies. In my case, I'm trying to install |
any workaround for this? |
this happened to me, when I have set |
Removing |
I am heavly slowed down by this issue, Can't even do any progress (need new packages from npm registry). Our project is in part of the error log is hereArguments: /home/marek/.nvm/versions/node/v8.11.4/bin/node /usr/share/yarn/lib/cli.js add uuid |
I found a stupid workaround, just specify version like this |
This started happening to me randomly with webpack in a repo where I've never used link. Yarn is now completely broken for me in that project. |
Was anybody able to tackle this problem eventually? |
I found out Woo |
Here is another concrete example: The above will throw the error:
But if I change the peerDependency in |
Also remove peerDeps of eslint-config due to some yarn error. Will come back at it later. yarnpkg/yarn#6285
This comment has been minimized.
This comment has been minimized.
I also ran into this in a monorepo, with a workspace that depended on |
We had multiple major versions (v9 vs v10) of dependencies duplicated across our monorepo project. |
for my case, my walk-around is moved all |
what's the theory behind this, it also works for me |
Just some random findings that maybe would allow somebody to pinpoint the issue. In my case, the problem was somehow caused by the fact that My bet would be that for some reason |
Confirmed clearing caches work. |
Removing nohoist help me get rid of this issue. |
Closing as fixed in v2 |
This showed up for me when a child package had I tried upgrading the dev dep, but didn't notice the peer dep and Yarn failed with the helpful error So check if the dependency is in multiple lists in the |
This should make it possible for `fc` to upgrade past v2, see https://github.com/careofvitamins/fc/pull/645#issuecomment-882796108 > Thanks for reviewing. I'm having some trouble resolving the merge conflict, will have to work on that and then re-request review. > > ``` > josephfrazier@C02WR4KZHTD615P:~/workspace/careof/fc/fulfillment$ yarn > yarn install v1.22.10 > info Merge conflict detected in yarn.lock and successfully merged. > [1/4] 🔍 Resolving packages... > [2/4] 🚚 Fetching packages... > info @ffmpeg-installer/[email protected]: The CPU architecture "x64" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > info @ffmpeg-installer/[email protected]: The platform "darwin" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > info @ffmpeg-installer/[email protected]: The CPU architecture "x64" is incompatible with this module. > info @ffmpeg-installer/[email protected]: The platform "darwin" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > info @ffmpeg-installer/[email protected]: The CPU architecture "x64" is incompatible with this module. > info @ffmpeg-installer/[email protected]: The platform "darwin" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > info @ffmpeg-installer/[email protected]: The CPU architecture "x64" is incompatible with this module. > info @ffmpeg-installer/[email protected]: The platform "darwin" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > info @ffmpeg-installer/[email protected]: The platform "darwin" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > info @ffmpeg-installer/[email protected]: The CPU architecture "x64" is incompatible with this module. > info @ffmpeg-installer/[email protected]: The platform "darwin" is incompatible with this module. > info "@ffmpeg-installer/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. > [3/4] 🔗 Linking dependencies... > warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0". > warning " > [email protected]" has incorrect peer dependency "eslint-plugin-jest@>= 24.3.6". > warning " > [email protected]" has incorrect peer dependency "mocha@>=2.2.0 <7.0.0". > error An unexpected error occurred: "could not find a copy of eslint to link in /Users/josephfrazier/workspace/careof/fc/fulfillment/node_modules/eslint-config-careof/node_modules". > info If you think this is a bug, please open a bug report with the information provided in "/Users/josephfrazier/workspace/careof/fc/fulfillment/yarn-error.log". > info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. > josephfrazier@C02WR4KZHTD615P:~/workspace/careof/fc/fulfillment$ > ``` > > Based on [yarnpkg/yarn#6285 (comment)](yarnpkg/yarn#6285 (comment)), it seems like this might be related to the fact that `eslint-config-careof` has `eslint` in multiple dependencies lists in the package.json: https://github.com/careofvitamins/eslint-config-careof/blob/b4725c781e6ef08a7f44264bea4a9a7b19d7fe92/package.json#L51-L67 > > I'll try to see if I can get it working with a fork, then open a PR there.
Confirmed working for |
Hermes parser is the preferred parser for Flow code going forward. We need to upgrade to this parser to support new Flow syntax like function `this` context type annotations or `ObjectType['prop']` syntax. Unfortunately, there's quite a few upgrades here to make it work somehow (dependencies between the changes) - ~Upgrade `eslint` to `8.*`~ reverted this as the React eslint plugin tests depend on the older version and there's a [yarn bug](yarnpkg/yarn#6285) that prevents `devDependencies` and `peerDependencies` to different versions. - Remove `eslint-config-fbjs` preset dependency and inline the rules, imho this makes it a lot clearer what the rules are. - Remove the turned off `jsx-a11y/*` rules and it's dependency instead of inlining those from the `fbjs` config. - Update parser and dependency from `babel-eslint` to `hermes-eslint`. - `ft-flow/no-unused-expressions` rule replaces `no-unused-expressions` which now allows standalone type asserts, e.g. `(foo: number);` - Bunch of globals added to the eslint config - Disabled `no-redeclare`, seems like the eslint upgrade started making this more precise and warn against re-defined globals like `__EXPERIMENTAL__` (in rollup scripts) or `fetch` (when importing fetch from node-fetch). - Minor lint fixes like duplicate keys in objects.
Hermes parser is the preferred parser for Flow code going forward. We need to upgrade to this parser to support new Flow syntax like function `this` context type annotations or `ObjectType['prop']` syntax. Unfortunately, there's quite a few upgrades here to make it work somehow (dependencies between the changes) - ~Upgrade `eslint` to `8.*`~ reverted this as the React eslint plugin tests depend on the older version and there's a [yarn bug](yarnpkg/yarn#6285) that prevents `devDependencies` and `peerDependencies` to different versions. - Remove `eslint-config-fbjs` preset dependency and inline the rules, imho this makes it a lot clearer what the rules are. - Remove the turned off `jsx-a11y/*` rules and it's dependency instead of inlining those from the `fbjs` config. - Update parser and dependency from `babel-eslint` to `hermes-eslint`. - `ft-flow/no-unused-expressions` rule replaces `no-unused-expressions` which now allows standalone type asserts, e.g. `(foo: number);` - Bunch of globals added to the eslint config - Disabled `no-redeclare`, seems like the eslint upgrade started making this more precise and warn against re-defined globals like `__EXPERIMENTAL__` (in rollup scripts) or `fetch` (when importing fetch from node-fetch). - Minor lint fixes like duplicate keys in objects. DiffTrain build for [2b1fb91](2b1fb91) [View git log for this commit](https://github.com/facebook/react/commits/2b1fb91a55deb9b7b60452cb57184c2f182a42fd)
Having fixed versions broke yarn, see: yarnpkg/yarn#6285
Hermes parser is the preferred parser for Flow code going forward. We need to upgrade to this parser to support new Flow syntax like function `this` context type annotations or `ObjectType['prop']` syntax. Unfortunately, there's quite a few upgrades here to make it work somehow (dependencies between the changes) - ~Upgrade `eslint` to `8.*`~ reverted this as the React eslint plugin tests depend on the older version and there's a [yarn bug](yarnpkg/yarn#6285) that prevents `devDependencies` and `peerDependencies` to different versions. - Remove `eslint-config-fbjs` preset dependency and inline the rules, imho this makes it a lot clearer what the rules are. - Remove the turned off `jsx-a11y/*` rules and it's dependency instead of inlining those from the `fbjs` config. - Update parser and dependency from `babel-eslint` to `hermes-eslint`. - `ft-flow/no-unused-expressions` rule replaces `no-unused-expressions` which now allows standalone type asserts, e.g. `(foo: number);` - Bunch of globals added to the eslint config - Disabled `no-redeclare`, seems like the eslint upgrade started making this more precise and warn against re-defined globals like `__EXPERIMENTAL__` (in rollup scripts) or `fetch` (when importing fetch from node-fetch). - Minor lint fixes like duplicate keys in objects. DiffTrain build for [2b1fb91a55deb9b7b60452cb57184c2f182a42fd](facebook/react@2b1fb91) [View git log for this commit](https://github.com/facebook/react/commits/2b1fb91a55deb9b7b60452cb57184c2f182a42fd)
In my case, the version was the same in both devDependencies and peerDependencies ( |
Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
When doing
yarn install
, I get an linking error at the very end whenyarn
attempts to link packages under the hood, causing the overall install to fail.If the current behavior is a bug, please provide the steps to reproduce.
This is consistently reproducible when running a simple
yarn install
. This was also present in version1.9.2
, but I waited to see if1.9.4
would fix it, as it was a fast-follow.Here is the (sanitized) error in trace in my
yarn-error.log
=>What is the expected behavior?
To install properly!
Please mention your node.js, yarn and operating system version.
Node => 8.11.4
Yarn => 1.9.4
OS => Manjaro Linux (Arch-based)
If there is more specific information I can provide to help, please let me know.
The text was updated successfully, but these errors were encountered: