RUDE

Как исправить эту ошибку: ошибка TS2456: псевдоним типа «Геометрия» циклически ссылается на себя?

У меня есть проект maven в html, css и typescript. Когда я запускаю команду: mvn clean install, у меня возникает эта ошибка:

ERROR in node_modules/@types/geojson/index.d.ts(79,13): error TS2456: Type alias 'Geometry' circularly references itself.

[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:35 min
[INFO] Finished at: 2022-07-19T09:23:23+00:00
[INFO] Final Memory: 8M/241M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (angular-cli build) on project TrimlyAngular: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (angular-cli build) on project TrimlyAngular: Command execution failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:302)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
    ... 22 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Вот мой файл package.json:

{
  "name": "project-name",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod --aot=true --base-href",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "fixture-backend": "node fixture-server/fixture-server.js",
    "fixture-frontend": "ng serve --proxy-conf fixture-server/fixture-proxy-conf.json",
    "start-fixture": " concurrently  \"npm run fixture-backend\" \"npm run fixture-frontend\" "
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/build-angular": "^0.8.9",
    "@angular/animations": "^6.1.10",
    "@angular/cdk": "^5.2.5",
    "@angular/compiler": "^6.1.10",
    "@angular/forms": "^6.1.10",
    "@angular/http": "^6.1.10",
    "@angular/language-service": "^6.1.10",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "^6.1.10",
    "@angular/platform-browser-dynamic": "^6.1.10",
    "@angular/router": "^6.1.10",
    "@babel/core": "^7.10.2",
    "@babel/plugin-proposal-class-properties": "^7.10.1",
    "@babel/preset-react": "^7.10.1",
    "@beyerleinf/ngx-dnd": "^6.0.4",
    "@gooddata/react-components": "^7.6.1",
    "@recogito/annotorious-openseadragon": "^2.0.5",
    "@recogito/recogito-client-core": "^0.1.5",
    "@swimlane/dragula": "^3.8.0",
    "@swimlane/ngx-dnd": "^5.1.0",
    "@types/cropperjs": "^1.3.0",
    "@types/react": "^16.9.36",
    "angular-font-awesome": "^3.1.2",
    "angular-material": "^1.1.7",
    "angular-tree-component": "^7.2.1",
    "angular2-datetimepicker": "^1.1.1",
    "axiom-ngx-tree": "^1.0.1",
    "babel-loader": "^8.1.0",
    "body-parser": "^1.19.0",
    "bowser": "^2.11.0",
    "classlist.js": "1.1.20150312",
    "concurrently": "^5.2.0",
    "cookie-parser": "^1.4.5",
    "core-js": "^2.4.1",
    "cropperjs": "^1.5.9",
    "crypto-js": "^3.3.0",
    "d3": "^4.13.0",
    "dpdm": "^3.5.0",
    "exifr": "^7.1.3",
    "file-saver": "^2.0.2",
    "font-awesome": "^4.7.0",
    "invariant": "^2.2.4",
    "ionic2-rating": "^1.2.2",
    "jquery": "^3.3.1",
    "levon-angular-star-rating": "^3.0.0",
    "mime": "^2.4.6",
    "missing": "0.0.1",
    "ng-click-outside": "^4.0.0",
    "ng-pick-datetime": "^5.2.6",
    "ng2-nouislider": "^1.7.7",
    "ng2-pdfjs-viewer": "^3.2.2",
    "ngx-color": "7.0.0",
    "ngx-cookie": "^3.0.1",
    "ngx-cookie-service": "^1.0.10",
    "ngx-datatable-with-ie-fix": "^8.0.0",
    "ngx-drag-and-drop-lists": "1.1.7",
    "ngx-notification-bar": "^0.1.4",
    "ngx-perfect-scrollbar": "^5.3.5",
    "ngx-tree-dnd": "^2.6.0",
    "node-sass": "^4.0.0",
    "nouislider": "^11.0.3",
    "npm-install-missing": "^0.1.4",
    "openseadragon": "^2.4.2",
    "phantomjs": "^2.1.7",
    "rater-js": "^0.5.8",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "rxjs": "^6.6.3",
    "rxjs-compat": "^6.0.0-rc.0",
    "ts-md5": "^1.2.7",
    "uuid": "^8.1.0",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "^6.2.9",
    "@angular/compiler-cli": "^6.1.10",
    "@types/d3": "^4.13.12",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/jquery": "^3.3.1",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "husky": "^4.3.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^3.1.4",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^1.1.2",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-istanbul-preprocessor": "0.0.2",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.4",
    "madge": "^3.12.0",
    "prettier": "^2.1.2",
    "pretty-quick": "^3.1.0",
    "protractor": "^5.1.2",
    "sass-resources-loader": "^2.0.3",
    "ts-node": "~4.1.0",
    "tslint": "^5.9.1",
    "tslint-config-prettier": "^1.18.0",
    "tslint-etc": "^1.10.1",
    "typescript": "~2.9.2"
  }
}

Я искал в Интернете, и я уже сделал это:

  • Удалите папку package-lock.json и node_modules, а затем запустите npm install ;
  • Измените версию машинописного текста в package.json.

Заранее благодарю за помощь.


2
463
2

Ответы:

Решено

С моей стороны, была зависимость 'geojson', которая вызывалась чем-то и всегда обновлялась. Недавнее изменение обновления и сломало мой проект. Поэтому я добавляю эту зависимость с конкретной версией в файл package.json, и проблема решена.

"@types/geojson": "7946.0.8"

Обновлено: как сказал MaciejLisCK, после этого вам нужно вызвать npm install.


Для меня проблема была связана с внедрением geojson в другую зависимость, в которой не была указана версия. Я добавляю это в свой package.json, чтобы решить проблему. У меня не работало без раздела "resolutions".

"dependencies": {
    "@types/geojson": "7946.0.8"
},
"resolutions": {
    "@types/geojson": "7946.0.8"
}