Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: Cannot find module "tslib"

I am testing my angular application and after some success test without changing anything I am getting the following error:

HeadlessChrome 68.0.3440 (Mac OS X 10.12.6) ERROR Uncaught Error: Cannot find module "tslib". at http://localhost:9877/_karma_webpack_/main.js:150

Does someone have the same problem?

package.json
{
  "name": "test",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "cross-env ng serve",
    "start:proxy": "cross-env ng serve --proxy-config proxy.conf.json",
    "mock:server": "json-server --watch data.json",
    "start:ps": "cross-env concurrently --kill-others \"npm run mock:server\" \"npm run start:proxy\"",
    "build": "ng build",
    "test": "ng test --watch=false",
    "test:local:coverage": "ng test --watch=false --codeCoverage",
    "test:local:watch": "ng test --watch=true",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "show:coverage": "http-server -c-1 -o -p 9875 ./coverage",
    "pre-push": "npm run lint && npm run build && npm run test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.1.4",
    "@angular/cdk": "^6.4.6",
    "@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": "^6.4.6",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "bootstrap": "^4.1.3",
    "core-js": "^2.5.4",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "http-server": "^0.11.1",
    "intl": "^1.2.5",
    "normalize.css": "^8.0.0",
    "rxjs": "^6.2.2",
    "rxjs-compat": "^6.2.2",
    "tslib": "^1.9.3",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^6.0.3",
    "@angular-devkit/build-angular": "~0.6.8",
    "typescript": "~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",
    "concurrently": "^4.0.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1"
  }
}
like image 426
Caesar Avatar asked Aug 28 '18 19:08

Caesar


1 Answers

Somewhere in your sources you have:

import { ... } @angular/compiler/src/core

Where you should instead have:

import { ... } @angular/core

like image 99
RJFalconer Avatar answered Oct 17 '22 12:10

RJFalconer