1

I'm trying to build the angular 6 app using webpack.

getting error as

ERROR in ./src/main.ts Module build failed (from ./node_modules/@ngtools/webpack/src/index.js): Error: Cannot find module '@angular/compiler-cli/ngcc'

package.json

{
  "name": "cloud-complince",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "webpack",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.1.10",
    "@angular/common": "^6.1.10",
    "@angular/compiler": "^6.1.10",
    "@angular/core": "^6.1.10",
    "@angular/forms": "^6.1.10",
    "@angular/http": "^6.1.10",
    "@angular/platform-browser": "^6.1.10",
    "@angular/platform-browser-dynamic": "^6.1.10",
    "@angular/router": "^6.1.10",
    "chart.js": "^2.8.0",
    "chartjs-plugin-datalabels": "^0.4.0",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.6.9",
    "ngx-cookie": "^3.0.1",
    "rxjs": "~6.2.0",
    "rxjs-compat": "^6.5.2",
    "web-animations-js": "^2.3.2",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.8.9",
    "@angular/cli": "^6.2.7",
    "@angular/compiler-cli": "^6.1.0",
    "@angular/language-service": "^6.1.10",
    "@ngtools/webpack": "^8.1.1",
    "@types/jasmine": "^2.8.16",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.3.0",
    "copy-webpack-plugin": "^4.6.0",
    "html-webpack-plugin": "^2.30.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.2",
    "raw-loader": "^0.5.1",
    "script-ext-html-webpack-plugin": "^1.8.8",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~2.9.2",
    "webpack": "4.24.0"
  }
}

tsconfig.json

    {
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "skipLibCheck": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

Kindly help me to resolve this issue

Thanks in advance

1 Answer 1

1

Try these command to see if it work

npm uninstall angular-cli -g
npm uninstall angular-cli --save
npm install -g @angular/cli
npm install @angular/cli --save
npm install @angular/compiler-cli --save
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.