ng build в угловом - PullRequest
       21

ng build в угловом

0 голосов
/ 28 февраля 2019

когда я запускаю "ng build" в моем проекте, появляются следующие ошибки:

ERROR in ../../node_modules/@auth0/angular-jwt/index.d.ts(1,47): error TS2307: Cannot find module '@angular/core'. ../../node_modules/@auth0/angular-jwt/src/jwt.interceptor.d.ts(1,70): error TS2307: Cannot find module '@angular/common/http'. ../../node_modules/@auth0/angular-jwt/src/jwt.interceptor.d.ts(3,28): error TS2307: Cannot find module 'rxjs/internal/Observable'. ../../node_modules/@auth0/angular-jwt/src/jwtoptions.token.d.ts(1,32): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/accordion/accordion-group.component.d.ts(1,49): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/accordion/accordion.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/alert/alert.component.d.ts(1,57): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/alert/alert.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/buttons/button-checkbox.directive.d.ts(1,34): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/buttons/button-checkbox.directive.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/buttons/button-radio-group.directive.d.ts(1,45): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/buttons/button-radio-group.directive.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/buttons/button-radio.directive.d.ts(1,76): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/buttons/button-radio.directive.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/buttons/buttons.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/carousel/carousel.component.d.ts(17,49): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/carousel/carousel.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/carousel/slide.component.d.ts(1,35): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/collapse/collapse.directive.d.ts(1,53): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/collapse/collapse.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/component-loader/bs-component-ref.class.d.ts(1,47): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/component-loader/component-loader.class.d.ts(1,197): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/component-loader/component-loader.factory.d.ts(1,117): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/component-loader/content-ref.class.d.ts(5,39): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/base/bs-datepicker-container.d.ts(3,28): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker-inline.component.d.ts(1,116): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker-inline.component.d.ts(3,30): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker-input.directive.d.ts(1,58): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker-input.directive.d.ts(2,84): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker.component.d.ts(1,116): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker.component.d.ts(3,30): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/bs-datepicker.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/bs-daterangepicker-input.directive.d.ts(1,58): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/bs-daterangepicker-input.directive.d.ts(2,84): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/datepicker/bs-daterangepicker.component.d.ts(1,116): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/bs-daterangepicker.component.d.ts(3,30): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/bs-locale.service.d.ts(1,45): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/datepicker-inner.component.d.ts(1,64): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/datepicker.component.d.ts(1,40): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/datepicker.component.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/datepicker/datepicker.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/daypicker.component.d.ts(1,24): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/monthpicker.component.d.ts(1,24): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/reducer/bs-datepicker.effects.d.ts(1,28): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-datepicker-container.component.d.ts(1,49): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-datepicker-container.component.d.ts(8,30): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-datepicker-day-decorator.directive.d.ts(1,47): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-datepicker-inline-container.component.d.ts(1,35): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-datepicker-navigation-view.component.d.ts(1,30): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-daterangepicker-container.component.d.ts(1,49): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-daterangepicker-container.component.d.ts(8,30): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-days-calendar-view.component.d.ts(1,30): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-months-calendar-view.component.d.ts(1,30): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/themes/bs/bs-years-calendar-view.component.d.ts(1,30): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/datepicker/yearpicker.component.d.ts(1,24): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/dropdown/bs-dropdown-container.component.d.ts(1,69): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/dropdown/bs-dropdown-menu.directive.d.ts(1,47): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/dropdown/bs-dropdown-toggle.directive.d.ts(1,39): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/dropdown/bs-dropdown.directive.d.ts(1,90): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/dropdown/bs-dropdown.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/dropdown/bs-dropdown.state.d.ts(1,30): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/mini-ngrx/state.class.d.ts(5,45): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/mini-ngrx/store.class.d.ts(4,48): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/modal/bs-modal.service.d.ts(1,75): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/modal/modal-backdrop.component.d.ts(1,47): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/modal/modal-container.component.d.ts(1,58): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/modal/modal.directive.d.ts(1,104): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/modal/modal.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/pagination/pager.component.d.ts(1,79): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/pagination/pager.component.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/pagination/pagination.component.d.ts(1,79): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/pagination/pagination.component.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/pagination/pagination.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/popover/popover.directive.d.ts(1,103): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/popover/popover.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/positioning/positioning.service.d.ts(1,28): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/progressbar/bar.component.d.ts(1,35): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/progressbar/progressbar.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/rating/rating.component.d.ts(1,70): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/rating/rating.component.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/rating/rating.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/sortable/draggable-item.service.d.ts(1,25): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/sortable/sortable.component.d.ts(1,43): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/sortable/sortable.component.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/sortable/sortable.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/tabs/ng-transclude.directive.d.ts(1,47): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/tabs/tab-heading.directive.d.ts(1,29): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/tabs/tab.directive.d.ts(1,85): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/tabs/tabs.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/tabs/tabset.component.d.ts(1,38): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/timepicker/models/index.d.ts(1,32): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/timepicker/models/index.d.ts(2,38): error TS2307: Cannot find module '@angular/forms/src/directives/control_value_accessor'. ../../node_modules/ngx-bootstrap/timepicker/models/index.d.ts(3,22): error TS2307: Cannot find module '@angular/core/src/type'. ../../node_modules/ngx-bootstrap/timepicker/timepicker.component.d.ts(1,86): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/timepicker/timepicker.component.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/timepicker/timepicker.component.d.ts(7,30): error TS2307: Cannot find module 'rxjs'. ../../node_modules/ngx-bootstrap/timepicker/timepicker.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/tooltip/tooltip-container.component.d.ts(1,31): ../../node_modules/ngx-bootstrap/typeahead/typeahead.directive.d.ts(1,122): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/typeahead/typeahead.directive.d.ts(2,27): error TS2307: Cannot find module '@angular/forms'. ../../node_modules/ngx-bootstrap/typeahead/typeahead.module.d.ts(1,37): error TS2307: Cannot find module '@angular/core'. ../../node_modules/ngx-bootstrap/utils/triggers.d.ts(5,27): error TS2307: Cannot find module '@angular/core'. Почему у меня эти ошибки?

Ответы [ 2 ]

0 голосов
/ 01 марта 2019

Файл Package.json:

{"name": "pwa-spa", "version": "0.0.0", "scripts": {"ng": "ng", "start":" ng serve "," build ":" ng build "," test ":" ng test "," lint ":" ng lint "," e2e ":" ng e2e "}," private ": true,"зависимости": {"@ angular / animations": "^ 6.0.3", "@ angular / cdk": "^ 7.3.3", "@ angular / common": "^ 6.0.3", "@angular/ compiler ":" ^ 6.0.3 "," @ angular / core ":" ^ 6.0.3 "," @ angular / forms ":" ^ 6.0.3 "," @ angular / http ":" ^ 6.0.3 "," @ angular / material ":" ^ 7.3.3 "," @ angular / platform-browser ":" ^ 6.0.3 "," @ angular / platform-browser-dynamic ":" ^ 6.0.3 ", "@ angular / pwa": "^ 0.13.1", "@ angular / router": "^ 6.0.3", "@ angular / service-worker": "^ 6.0.3", "core-js": "^ 2.5.4", "rxjs": "^ 6.0.0", "zone.js": "^ 0.8.26"}, "devDependencies": {"@ angular / compiler-cli": "^ 6.0.3 "," @ angular-devkit / build-angular ":" ~ 0.6.8 "," typcript ":" ~ 2.7.2 "," @ angular / cli ":" ~ 6.0.8 "," @angular/ language-service ":" ^ 6.0.3 "," @ types / jasmine ":" ~ 2.8.6 "," @ types / jasminewd2 ":" ~ 2.0.3 "," @ types / node ":" ~8.9.4 "," codelyzer ":" ~ 4.2.1 "," jasmine-core ":" ~ 2.99.1 "," jasmine-spec-reporter ":" ~ 4.2.1 "," karma ":" ~ 1.7.1 "," karma-chrome-launcher ":"~ 2.2.0", "Карма-охват-Стамбул-репортер": "~ 2.0.0", "Карма-Жасмин": "~ 1.1.1", "Карма-Жасмин-HTML-репортер": "^ 0.2.2 "," транспортир ":" ~ 5.3.0 "," ts-node ":" ~ 5.0.1 "," tslint ":" ~ 5.9.1 "}}

0 голосов
/ 28 февраля 2019
  1. Убедитесь, что вы находитесь в папке вашего проекта:

  2. Я предполагаю, что вы посмотрели Угловое руководство по быстрому запуску и уже запустили:

    npm install -g @angular/cli

  3. Если вы скачали существующий архивированный проект без всех зависимых библиотек, запустите

    npm install

    • По сути, он создает записи в папке node_modules ,
    • для вашего package.json в папке вашего проекта.

    • Больше можно найти здесь .

  4. Запустите ng build.Подробнее здесь

Дайте мне знать, если это поможет.

...