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

2.21.0 error: "Cannot find module 'typescript' #1805

illepic opened this issue Jun 8, 2020 · 4 comments

2.21.0 error: "Cannot find module 'typescript' #1805

illepic opened this issue Jun 8, 2020 · 4 comments


Copy link

illepic commented Jun 8, 2020

Updating from 2.20.2 to 2.21.0 results in the following output:

Oops! Something went wrong! :(

ESLint: 7.2.0

Error: Failed to load plugin 'import' declared in '.eslintrc.js » eslint-config-airbnb-base » /home/illepic/dev/particle/node_modules/eslint-config-airbnb-base/rules/imports.js': Cannot find module 'typescript'
Require stack:
- /home/illepic/dev/particle/node_modules/eslint-plugin-import/lib/ExportMap.js
- /home/illepic/dev/particle/node_modules/eslint-plugin-import/lib/rules/named.js
- /home/illepic/dev/particle/node_modules/eslint-plugin-import/lib/index.js
- /home/illepic/dev/particle/node_modules/eslint/lib/cli-engine/config-array-factory.js
- /home/illepic/dev/particle/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js
- /home/illepic/dev/particle/node_modules/eslint/lib/cli-engine/cli-engine.js
- /home/illepic/dev/particle/node_modules/eslint/lib/eslint/eslint.js
- /home/illepic/dev/particle/node_modules/eslint/lib/eslint/index.js
- /home/illepic/dev/particle/node_modules/eslint/lib/cli.js
- /home/illepic/dev/particle/node_modules/eslint/bin/eslint.js
    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 (/home/illepic/dev/particle/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/illepic/dev/particle/node_modules/eslint-plugin-import/lib/ExportMap.js:46:19)
    at Module._compile (/home/illepic/dev/particle/node_modules/v8-compile-cache/v8-compile-cache.js:192: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)

Installing typescript locally (npm install typescript) resolves the error. Unfortunately, this is not a typescript project.

Copy link

githoniel commented Jun 8, 2020

@ljharb I think a new fixed version must be release asap because it will break all none-ts project new created

Copy link

I have the same problem! how to resolve it ?

Copy link

ljharb commented Jun 8, 2020

@githoniel yes, that's quite obvious thanks :-) #1806 is waiting on tests.

Copy link

Flowm commented Jun 8, 2020

Thanks for the fast fix!
Observed the same error with 2.21.0 and everything is working again with 2.21.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

No branches or pull requests

5 participants