nuxt / eslint

Collection of ESLint-related packages for Nuxt
https://eslint.nuxt.com
MIT License
556 stars 66 forks source link

Error: Cannot find module 'typescript' #514

Closed Revadike closed 3 weeks ago

Revadike commented 3 weeks ago

Environment

[Error - 10:53:53 AM] Calculating config file for file:///Projects/my-project/package.json) failed.
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/@typescript-eslint/parser/dist/parser.js
- /node_modules/@typescript-eslint/parser/dist/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)

Package

@nuxt/eslint

Reproduction

https://github.com/Revadike/reproduction

Describe the bug

This issue was fixed for a little while, when I first reported the issue, but sadly it's back yet again. Please check my reproduction. Even installing typescript does not fix this issue.

Additional context

No response

Logs

No response

Revadike commented 3 weeks ago

Found the issue. There was some weird problem with my environment, where it would load the dependencies from a parent folder for some reason. Consider this resolved.