question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find config when Node version > 12.x.x

See original GitHub issue

Tell us about your environment

  • ESLint Version: v6.8.0 (Currently used)
  • Node Version: v13.8.0
  • npm Version: v6.13.7

What parser (default, Babel-ESLint, etc.) are you using?

@typescript-eslint/parser

Please show your full configuration:

Configuration
module.exports =  {
    parser:  '@typescript-eslint/parser',
    extends:  [
        'preact',
        'plugin:@typescript-eslint/recommended',
        'prettier/@typescript-eslint',
        'plugin:prettier/recommended'
    ],
    settings: {
        react: {
            pragma: 'h',
            version: 'detect'
        },
    },
    parserOptions:  {
        ecmaVersion:  2018,
        sourceType:  'module',
        ecmaFeatures: {
            jsx: true
        }
    },
    ignorePatterns: ['build/'],
    rules:  {
        'indent': ['warn', 4, { "SwitchCase": 1, "ignoredNodes": ["TemplateLiteral > *"] }],
        'react/jsx-indent': ['warn', 4],
        'react/jsx-indent-props': ['warn', 4],
        'react/no-unknown-property': ['error', { ignore: ['class'] }],
        'react/no-unescaped-entities': ['warn'],
        'react/jsx-no-bind': ['off'],
        'quotes': 'off',
        '@typescript-eslint/quotes': ['warn', 'single'],
        '@typescript-eslint/no-use-before-define': ['off'],
        'arrow-parens': 'warn',
        '@typescript-eslint/ban-ts-ignore': ['warn'],
        '@typescript-eslint/interface-name-prefix': 'off',
        'semi': 'off',
        '@typescript-eslint/semi': ['warn'],
    },
    overrides: [
        {
            files: ["*.js"],
            rules: {
                "@typescript-eslint/explicit-function-return-type": "off",
            }
        }
    ]
};
eslint src/**/*.{js,ts,tsx} --fix

What did you expect to happen? Eslint to run against my application using the preact config

What actually happened? Please include the actual, raw output from ESLint.

Oops! Something went wrong! :(

ESLint: 6.8.0.

ESLint couldn't find the config "preact" to extend from. Please check that the name of the config is correct.

The config "preact" was referenced from the config file in "/x/x/x/.eslintrc.js".

I added the eslint-config-preact package to my application to replace the React config, as I do use Preact, and this was fine and worked on my machine. However, once the build server failed, I noticed multiple coworkers had the same issue. Eventually I came to checking versions of Node, and noticed Eslint won’t be able to find that config if the version is greater than 12.x.x.

If this isn’t an Eslint issue but an issue with the config itself, I can always create an issue there, but I’d assume it’s the underlying tool first.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ljharbcommented, Feb 23, 2020

Looks like “eslint-config-preact” is using the “exports” field, which is newly respected in node 13.3+, and the “conditional exports” feature, which was added in v13.7.

See https://unpkg.com/browse/eslint-config-preact@1.1.0/package.json, it’s using the “exports” field. The “main” and the “require” are the same, so it should work in v13.7+, but because it lacks a “default” as well, it will not work in node v13.3 - v13.6. (cc @developit)

I’m not sure why it wouldn’t be working in node v13.8, however.

1reaction
ljharbcommented, Mar 6, 2020

Indeed, that is true. Only main/bin have the legacy mistake of not requiring ./ for relative paths.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - npm - The system cannot find the path specified
The system cannot find the path specified. If I run node -v everything works fine. I can use npm via the nodejs console...
Read more >
Supported Node versions - Node-RED
If you change the version of Node.js you are using, you may need to rebuild Node-RED's dependencies as well as any nodes you...
Read more >
Configure Node.js apps - Azure App Service - Microsoft Learn
Learn how to configure a Node.js app in the native Windows instances, or in a pre-built Linux container, in Azure App Service.
Read more >
Node.js | WebStorm Documentation - JetBrains
js is installed in a non-default location so WebStorm does not detect it automatically. Press Ctrl+Alt+S to open the IDE settings and select ......
Read more >
How to Easily Update Node.js to the Latest Version
js. Before getting started, you can check the version of Node.js currently deployed on your system by running the following command on the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found