Compiling TypeScript sources through ngc TypeError: Cannot read property 'directoryExists' of undefined

2.9k views Asked by At

Updated from Angular CLI 1.7.0 to Angular 8.

Got everything working locally but failing on Build definition in 'npm packager' step.

Initially got error on missing tstickle and after adding it to package.json, "tsickle": "0.39.1"

2020-09-24T21:15:41.5201500Z Compiling TypeScript sources through ngc 2020-09-24T21:15:41.5201643Z 2020-09-24T21:15:41.5201764Z BUILD ERROR 2020-09-24T21:15:41.5201889Z TypeError: Cannot read property 'directoryExists' of undefined

Package.json:

{
  "name": "loginapp",
  "version": "20.9.1",
  "license": "A",
  "description": "Login App",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --baseHref=/Login/",
    "build:ssr": "npm run build -- --app=ssr --output-hashing=media",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "packagr": "ng-packagr -p ng-package.json && cpx ./src/assets/**/* ./dist/assets"
  },
  "private": false,
  "dependencies": {
    "@angular/animations": "^8.2.14",
    "@angular/common": "^8.2.14",
    "@angular/compiler": "^8.2.14",
    "@angular/core": "^8.2.14",
    "@angular/forms": "^8.2.14",
    "@angular/http": "^7.2.16",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "^8.2.14",
    "@angular/platform-server": "^8.2.14",
    "@angular/router": "^8.2.14",
    "@nguniversal/module-map-ngfactory-loader": "^5.0.0-beta.5",
    "aspnet-prerendering": "^3.0.1",
    "bootstrap": "^3.3.7",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "rxjs": "^6.6.3",
    "tslib": "^1.9.0",
    "web-animations-js": "^2.3.2",
    "zone.js": "^0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.29",
    "@angular/cli": "^8.3.29",
    "@angular/compiler-cli": "^8.2.14",
    "@angular/language-service": "^8.2.14",
    "@types/jasmine": "~2.8.9",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "cpx": "1.5.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "jwt-decode": "^2.2.0",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ng-packagr": "^3.0.6",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~3.5.3",
    "tsickle": "0.39.1"
  }
}

Any suggestions to fix this issue would be really appreciated.

0

There are 0 answers