Skip to content
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

Error: Cannot find module 'typescript' #494

Closed
Revadike opened this issue Sep 3, 2024 · 25 comments · Fixed by un-ts/eslint-plugin-import-x#146 or un-ts/eslint-plugin-import-x#145
Closed

Comments

@Revadike
Copy link

Revadike commented Sep 3, 2024

@antfu sadly v0.5.3 brought this bug back.

Originally posted by @Revadike in #485 (comment)

@antfu
Copy link
Member

antfu commented Sep 4, 2024

Can you give a new reproduction? We didn't change much about that part

@Revadike
Copy link
Author

Revadike commented Sep 4, 2024

IDK what changed, very odd, but now even v0.5.2 doesn't work anymore. It may be related to one of your dependencies? I believe it happened after doing yarn upgrade.

Here is the stack:

Error: Cannot find module 'typescript'
Require stack:
- /node_modules/@typescript-eslint/typescript-estree/dist/convert.js
- /node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js
- /node_modules/@typescript-eslint/typescript-estree/dist/parser.js
- /node_modules/@typescript-eslint/typescript-estree/dist/index.js
- /node_modules/eslint-plugin-import-x/lib/utils/parse.js
- /node_modules/eslint-plugin-import-x/lib/utils/export-map.js
- /node_modules/eslint-plugin-import-x/lib/utils/index.js
- /node_modules/eslint-plugin-import-x/lib/rules/consistent-type-specifier-style.js
- /node_modules/eslint-plugin-import-x/lib/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1152:15)
    at Module._load (node:internal/modules/cjs/loader:993:27)
    at c._load (node:electron/js2c/node_init:2:13801)
    at Module.require (node:internal/modules/cjs/loader:1240:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/node_modules/@typescript-eslint/typescript-estree/dist/convert.js:30:25)
    at Module._compile (node:internal/modules/cjs/loader:1373:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1432:10)
    at Module.load (node:internal/modules/cjs/loader:1215:32)
    at Module._load (node:internal/modules/cjs/loader:1031:12)

checking npm ls gives:

└─┬ @nuxt/[email protected]
  ├─┬ @nuxt/[email protected]
  │ ├─┬ @typescript-eslint/[email protected]
  │ │ └─┬ @typescript-eslint/[email protected]
  │ │   └── @typescript-eslint/[email protected] deduped
  │ ├─┬ @typescript-eslint/[email protected]
  │ │ └── @typescript-eslint/[email protected]
  │ └─┬ [email protected]
  │   └── @typescript-eslint/[email protected] deduped
  └─┬ @nuxt/[email protected]
    └─┬ @typescript-eslint/[email protected]
      └── @typescript-eslint/[email protected] deduped
      ```

@Revadike
Copy link
Author

Revadike commented Sep 4, 2024

@antfu
Copy link
Member

antfu commented Sep 4, 2024

@Revadike
Copy link
Author

Revadike commented Sep 4, 2024

Seems to introduced by this line: un-ts/eslint-plugin-import-x@34e1334/src/utils/parse.ts#L3

You might want to report to un-ts/eslint-plugin-import-x

Hmm, I checked their docs and it seems the difference between the plain js and ts version is the use of @typescript-eslint/parser. Are you using this? Always, or just with ts?

@antfu
Copy link
Member

antfu commented Sep 4, 2024

Always. Because it's about import and not TS specific. It's the side-effect they introduced.

@SukkaW
Copy link

SukkaW commented Sep 4, 2024

Was bought to here by un-ts/eslint-plugin-import-x@ac11f62#r146221700

Is it possible that typescript-estree declares typescript as its peer dependency? But it is an optional peer dependency which should not cause any problem.

@SukkaW
Copy link

SukkaW commented Sep 4, 2024

Might wanna raise the issue to typescript-eslint instead. It seems that importing withoutProjectParserOptions alone will also run loads of side effects that require typescript.

@antfu
Copy link
Member

antfu commented Sep 4, 2024

Importing the module (https://unpkg.com/browse/@typescript-eslint/[email protected]/dist/index.js) end up importing all the modules in typescript-estree, which end up with the side-effect that importing typescript - maybe they can do a pure submodule like @typescript-eslint/typescript-estree/withoutProjectParserOptions?

@Revadike
Copy link
Author

Revadike commented Sep 4, 2024

🎉

@SukkaW
Copy link

SukkaW commented Sep 4, 2024

@Revadike @antfu [email protected] is just released with the workaround included!

renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this issue Sep 4, 2024
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
@Revadike
Copy link
Author

Revadike commented Sep 5, 2024

A yarn upgrade did not fix it yet.
I think @antfu needs to update @nuxt/eslint first

@SukkaW
Copy link

SukkaW commented Sep 5, 2024

A yarn upgrade did not fix it yet.

The [email protected] also includes a new feature, so it is a minor change, not a patch change. yarn upgrade might not perform a minor bump.

@antfu antfu closed this as completed in 2108f75 Sep 5, 2024
@Revadike
Copy link
Author

Revadike commented Sep 6, 2024

Can confirm it's working now. Thanks again @SukkaW and @antfu!

@Revadike
Copy link
Author

I don't know what happened, but the error is back again...

Error: Cannot find module 'typescript'
Require stack:
- /node_modules/@typescript-eslint/typescript-estree/dist/convert.js
- /node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js
- /node_modules/@typescript-eslint/typescript-estree/dist/parser.js
- /node_modules/@typescript-eslint/typescript-estree/dist/index.js
- /node_modules/eslint-plugin-import-x/lib/utils/parse.js
- /node_modules/eslint-plugin-import-x/lib/utils/export-map.js
- /node_modules/eslint-plugin-import-x/lib/utils/index.js
- /node_modules/eslint-plugin-import-x/lib/rules/consistent-type-specifier-style.js
- /node_modules/eslint-plugin-import-x/lib/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1152:15)
    at Module._load (node:internal/modules/cjs/loader:993:27)
    at c._load (node:electron/js2c/node_init:2:13801)
    at Module.require (node:internal/modules/cjs/loader:1240:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/node_modules/@typescript-eslint/typescript-estree/dist/convert.js:30:25)
    at Module._compile (node:internal/modules/cjs/loader:1373:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1432:10)
    at Module.load (node:internal/modules/cjs/loader:1215:32)
    at Module._load (node:internal/modules/cjs/loader:1031:12)

@Revadike
Copy link
Author

I did a full clean install, but still getting this error

@antfu
Copy link
Member

antfu commented Sep 10, 2024

Please send a reproduction

@Revadike
Copy link
Author

Please send a reproduction

Still same link:
https://github.com/Revadike/reproduction

@antfu
Copy link
Member

antfu commented Sep 10, 2024

You are not even upgraded to v0.5.6

@Revadike
Copy link
Author

Revadike commented Sep 10, 2024

You are not even upgraded to v0.5.6

Check the yarn.lock file:

$ npm ls @nuxt/eslint
reproduction
└── @nuxt/[email protected]

@Revadike
Copy link
Author

Somehow, even installing typescript does not fix it...

Any progress @antfu ?
Are you not able to reproduce it?

@Revadike
Copy link
Author

@antfu please let me know if I can do anything to help

@SukkaW
Copy link

SukkaW commented Sep 16, 2024

@antfu

image

I am not able to reproduce the issue using his reproduction with yarn 1.22.21. I suspect he doesn't delete the .nuxt folder and re-run the codegen or he doesn't use the yarn 1.22.21. I recommend locking the issue.

@Revadike
Copy link
Author

Revadike commented Sep 16, 2024

@SukkaW hmm, you're right! I no longer have the issue with the updated version. I guess it got resolved on its own. If only everything could be that way.

renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this issue Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this issue Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this issue Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this issue Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
@Revadike
Copy link
Author

@antfu it's that time again to reopen this issue... why does it keep coming back?


Error: Cannot find module 'typescript'
Require stack:
- /node_modules/@typescript-eslint/typescript-estree/dist/convert.js
- /node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js
- /node_modules/@typescript-eslint/typescript-estree/dist/parser.js
- /node_modules/@typescript-eslint/typescript-estree/dist/index.js
- /node_modules/eslint-plugin-import-x/lib/utils/parse.js
- /node_modules/eslint-plugin-import-x/lib/utils/export-map.js
- /node_modules/eslint-plugin-import-x/lib/utils/index.js
- /node_modules/eslint-plugin-import-x/lib/rules/consistent-type-specifier-style.js
- /node_modules/eslint-plugin-import-x/lib/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1152:15)
    at Module._load (node:internal/modules/cjs/loader:993:27)
    at c._load (node:electron/js2c/node_init:2:13801)
    at Module.require (node:internal/modules/cjs/loader:1240:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/node_modules/@typescript-eslint/typescript-estree/dist/convert.js:30:25)
    at Module._compile (node:internal/modules/cjs/loader:1373:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1432:10)
    at Module.load (node:internal/modules/cjs/loader:1215:32)
    at Module._load (node:internal/modules/cjs/loader:1031:12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants