generator-jhipster: Error: Failed to load plugin '@typescript-eslint' declared in '../.eslintrc.json': Cannot find module '@typescript-eslint/eslint-plugin'

Overview of the issue

I have created a gateway application and I have tried to started it up on local.

when I am trying to build it with maven I am getting the following exception: Error: Failed to load plugin '@typescript-eslint' declared in '../.eslintrc.json': Cannot find module '@typescript-eslint/eslint-plugin'

The same apply to 4 other team members.

Seems like this is related to the failing npm build.

I have tried to update my npm, install eslint again but I couldn’t sort this out. Sorry if it is a misconfiguration and not a bug, but I couldn’t sort this out so I thought that maybe it is a bug

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (12 by maintainers)

Most upvoted comments

It’s already fixed on main branch as far as I know

I reproduced same error on Windows and fixed it by updating to latest versions of all eslint dev dependencies. Could you try? Below is the diff output:

diff --git a/package.json b/package.json
index fb0f5ed8..dc562429 100644
--- a/package.json
+++ b/package.json
@@ -101,7 +101,7 @@
   "devDependencies": {
     "@angular-builders/custom-webpack": "11.1.1",
     "@angular-builders/jest": "11.1.1",
-    "@angular-eslint/eslint-plugin": "2.0.2",
+    "@angular-eslint/eslint-plugin": "4.2.0",
     "@angular/cli": "11.2.6",
     "@angular/compiler-cli": "11.2.7",
     "@angular/service-worker": "11.2.7",
@@ -111,8 +111,8 @@
     "@types/mocha": "8.2.0",
     "@types/node": "14.14.37",
     "@types/selenium-webdriver": "4.0.11",
-    "@typescript-eslint/eslint-plugin": "4.20.0",
-    "@typescript-eslint/parser": "4.20.0",
+    "@typescript-eslint/eslint-plugin": "4.22.1",
+    "@typescript-eslint/parser": "4.22.1",
     "browser-sync": "2.26.14",
     "browser-sync-webpack-plugin": "2.3.0",
     "chai": "4.2.0",
@@ -122,7 +122,7 @@
     "copy-webpack-plugin": "6.4.1",
     "eslint": "7.23.0",
     "eslint-config-prettier": "8.1.0",
-    "eslint-webpack-plugin": "2.5.3",
+    "eslint-webpack-plugin": "2.5.4",
     "friendly-errors-webpack-plugin": "1.7.0",
     "generator-jhipster": "7.0.1",
     "husky": "4.3.8",

The issue is still happening as today.

The error appear generating a new project with jhipster and khipster, deleting the node_modules does times work but only temporarily, at the next compilation i get the error again.

I have tried the above versions(although now outdated) as well as the latest versions.

Thanks @gmarziou. That solved my issue as well.

Adding a bounty as it’s a bug