Angular - error TS2307: Cannot find module 'ngx-bootstrap/modal'

rajat garg picture rajat garg · Nov 23, 2018 · Viewed 15.4k times · Source

I have installed ngx-bootstrap using the command npm install ngx-bootstrap --save but still when i am trying to build the solution it says

ERROR in src/app/app.module.ts(37,45): error TS2307: Cannot find module 'ngx-bootstrap/modal'.

I have checked in the node_modules folder ngx-bootstrap/modal is present there.

here is my package

 {
  "name": "test-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.1.0",
    "@angular/common": "^5.1.0",
    "@angular/compiler": "^5.1.0",
    "@angular/core": "^5.1.0",
    "@angular/forms": "^5.1.0",
    "@angular/http": "^5.1.0",
    "@angular/platform-browser": "^5.1.0",
    "@angular/platform-browser-dynamic": "^5.1.0",
    "@angular/router": "^5.1.0",
    "@ng-select/ng-select": "^1.6.3",
    "@ngx-translate/core": "^9.1.1",
    "@ngx-translate/http-loader": "^2.0.1",
    "angular2-jwt": "^0.2.3",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "intl": "^1.2.5",
    "jquery": "^3.3.1",
    "moment": "^2.22.2",
    "ng2-select2": "^1.0.0-beta.16",
    "ngx-bootstrap": "^3.1.2",
    "ngx-drag-and-drop-lists": "1.1.3",
    "ngx-logger": "^3.1.0",
    "ngx-moment": "^3.1.0",
    "ngx-mydatepicker": "^2.4.9",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "^1.5.6",
    "@angular/compiler-cli": "^5.1.0",
    "@angular/language-service": "^5.1.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage": "^1.1.2",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.4",
    "node-sass": "^4.9.0",
    "phantomjs": "^2.1.7",
    "protractor": "^5.3.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

can anyone please help

Answer

Jay picture Jay · Dec 4, 2018

Try using this npm install [email protected] --save it might work!