-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Yarn 2: Error: Failed to load config "xo/esnext" to extend from.
#418
Comments
I would recommend opening an issue on the Yarn 2 repo about this incompatibility. I’m sure it affects ESLint too. I don’t use Yarn, so I’m not going to spend any time looking into this, unfortunately. |
I'm getting the same exact error when installing with Yarn 1.22.4 ( |
with npm 6.13.7 too :( |
Using yarn v1.x and same issue: ~/Projects/graceful master* 19s
❯ yarn test
yarn run v1.22.4
$ npm run lint && npm run test-coverage
npm WARN lifecycle The node binary used for scripts is /var/folders/t_/4vd3m1h92zsc953ll8r_4s_h0000gn/T/yarn--1594219180323-0.28126307126174055/node but npm is using /Users/someuser/.nvm/versions/node/v12.18.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> @ladjs/[email protected] lint /Users/someuser/Projects/graceful
> xo && remark . -qfo
Error: Cannot find module 'lodash/fp'
Require stack:
- /Users/someuser/Projects/graceful/node_modules/enhance-visitors/index.js
- /Users/someuser/Projects/graceful/node_modules/eslint-plugin-ava/rules/assertion-arguments.js
- /Users/someuser/Projects/graceful/node_modules/import-modules/index.js
- /Users/someuser/Projects/graceful/node_modules/eslint-plugin-ava/index.js
- /Users/someuser/Projects/graceful/node_modules/eslint/lib/config/plugins.js
- /Users/someuser/Projects/graceful/node_modules/eslint/lib/config.js
- /Users/someuser/Projects/graceful/node_modules/eslint/lib/cli-engine.js
- /Users/someuser/Projects/graceful/node_modules/eslint/lib/api.js
- /Users/someuser/Projects/graceful/node_modules/xo/index.js
- /Users/someuser/Projects/graceful/node_modules/xo/cli-main.js
- /Users/someuser/Projects/graceful/node_modules/xo/cli.js
Referenced from:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/someuser/Projects/graceful/node_modules/enhance-visitors/index.js:3:11)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ladjs/[email protected] lint: `xo && remark . -qfo`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ladjs/[email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/someuser/.npm/_logs/2020-07-08T14_39_41_648Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
~/Projects/graceful master*
❯ yarn --version |
@sindresorhus Same error with npm v6.14.8 |
A workaround for Yarn 2 is to add all the relevant ESLint config packages and plugins as direct devDependencies of your project, e.g.
Probably relevant: yarnpkg/berry#8, eslint/eslint#3458. |
That workaround fails, though, with $ yarn run xo
Error: Cannot read config file: /home/anders/.yarn/berry/cache/xo-npm-0.34.2-8d37d87fc6-7.zip/node_modules/xo/config/plugins.js
Error: Cannot find module '/home/anders/.yarn/berry/cache/xo-npm-0.34.2-8d37d87fc6-7.zip/node_modules/xo/config/plugins.js'
Require stack:
- /home/anders/.yarn/berry/cache/@eslint-eslintrc-npm-0.2.1-88318143fb-7.zip/node_modules/@eslint/eslintrc/lib/noop.js
Require stack:
- /home/anders/.yarn/berry/cache/@eslint-eslintrc-npm-0.2.1-88318143fb-7.zip/node_modules/@eslint/eslintrc/lib/noop.js
Referenced from: BaseConfig
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.external_module_.Module._resolveFilename (/tmp/z/.pnp.js:11698:54)
at resolveFileName (/home/anders/.yarn/berry/cache/resolve-from-npm-4.0.0-f758ec21bf-7.zip/node_modules/resolve-from/index.js:29:39)
at resolveFrom (/home/anders/.yarn/berry/cache/resolve-from-npm-4.0.0-f758ec21bf-7.zip/node_modules/resolve-from/index.js:43:9)
at module.exports (/home/anders/.yarn/berry/cache/resolve-from-npm-4.0.0-f758ec21bf-7.zip/node_modules/resolve-from/index.js:46:41)
at module.exports (/home/anders/.yarn/berry/cache/import-fresh-npm-3.2.2-509b4e1291-7.zip/node_modules/import-fresh/index.js:14:19)
at loadJSConfigFile (/home/anders/.yarn/berry/cache/@eslint-eslintrc-npm-0.2.1-88318143fb-7.zip/node_modules/@eslint/eslintrc/lib/config-array-factory.js:225:16)
at loadConfigFile (/home/anders/.yarn/berry/cache/@eslint-eslintrc-npm-0.2.1-88318143fb-7.zip/node_modules/@eslint/eslintrc/lib/config-array-factory.js:308:20)
at ConfigArrayFactory._loadConfigData (/home/anders/.yarn/berry/cache/@eslint-eslintrc-npm-0.2.1-88318143fb-7.zip/node_modules/@eslint/eslintrc/lib/config-array-factory.js:608:42)
at ConfigArrayFactory._loadExtendedShareableConfig (/home/anders/.yarn/berry/cache/@eslint-eslintrc-npm-0.2.1-88318143fb-7.zip/node_modules/@eslint/eslintrc/lib/config-array-factory.js:883:21) |
weirdly, i only have this issue inside of JetBrains IDEs. (I haven't tested everywhere.) I've tried various ways of installing and picking which bin to use (local vs global, different versions, etc). And consistently, it works in the terminal but not in my IDE. So I'm guessing there's something dependent on shell or env var shenanigans. (At least, if also using |
I am upgrading to Yarn 2 and I am now getting the following error
I am only extending
xo-typescript
in my XO config and this error only started occurring after using Yarn 2.I believe the error is due to Yarn 2's "strict package boundaries".
The text was updated successfully, but these errors were encountered: