angular2-realtimegeolocation / index.ts отсутствует в компиляции TypeScript - PullRequest
0 голосов
/ 15 марта 2019

Я установил пакет npm nemex-angular2-realtimegeolocation для доступа к геолокации. Однако я сталкиваюсь с ошибкой -

./node_modules/nemex-angular2-realtimegeolocation/index.ts
Module build failed: Error: /home/dell/Downloads/Angular-6-Templates/5th March-2019/node_modules/nemex-angular2-realtimegeolocation/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. 

Я пытался включить файлы в tsconfig.spec.json и tsconfig.app.json, как указано в различных источниках, но безрезультатно.

Изменения сделаны:

[1] tsconfig.spec.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/spec",
    "baseUrl": "./",
    "module": "commonjs",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "test.ts",
    "polyfills.ts",
    "index.ts",
    "../node_modules/nemex-angular2-realtimegeolocation/index.ts"
  ],
  "include": [
    "**/*.spec.ts",
    "**/*.d.ts",
    "**/*.index.ts",
    "../src/**/*",
    "../node_modules/nemex-angular2-realtimegeolocation/index.ts"
  ]
}

[2]

tsconfig.app.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": [],
    "paths": {
      "@angular/*": [
        "../node_modules/@angular/*"
      ]
    }
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts",
    "../node_modules/nemex-angular2-realtimegeolocation/**/*.spect.ts"
  ]
}

[3] Я даже удалил файл index.ts из nemex-angular2-realtimegeolocation, но он выдает ошибку index.ts «file not found».

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...