Skip to content

Add usage sample for Yarn to README #145

@Tomalak

Description

@Tomalak

When using Yarn in PnP mode (the default) as the package manager, trying the documented run command

npx @eslint/config-inspector@latest

fails with an error message along the lines of the following:
(also note that it always says eslint.config.js, even if it's actually e.g. eslint.config.mjs)

Failed to load `eslint.config.js`.
https://eslint.org/docs/latest/use/configure/configuration-files-new
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'globals' imported from C:\config-inspector-test\eslint.config.bundled_dso4w158dx.mjs  
    at new NodeError (node:internal/errors:406:5)
    at moduleResolve (node:internal/modules/esm/resolve:838:20)
    at defaultResolve (node:internal/modules/esm/resolve:1043:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

because npx has no idea how to resolve Yarn packages.

The way to successfully run it with Yarn would be

yarn add -D @eslint/config-inspector

and then

yarn run config-inspector

which would be a helpful addition to the usage section of the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions