Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Cannot find module '@angular/compiler-cli

I am getting the below mentioned error when I execute ng s --open command:

Cannot find module '@angular/compiler-cli' Error: Cannot find module '@angular/compiler-cli' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:655:15) at Function.Module._load (internal/modules/cjs/loader.js:580:25) at Module.require (internal/modules/cjs/loader.js:711:19) at require (internal/modules/cjs/helpers.js:14:16) at Object. (G:\Front-End\angular\rapydly\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:12:24) at Module._compile (internal/modules/cjs/loader.js:805:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10) at Module.load (internal/modules/cjs/loader.js:672:32) at tryModuleLoad (internal/modules/cjs/loader.js:612:12) at Function.Module._load (internal/modules/cjs/loader.js:604:3) at Module.require (internal/modules/cjs/loader.js:711:19) at require (internal/modules/cjs/helpers.js:14:16) at Object. (G:\Front-End\angular\rapydly\node_modules@ngtools\webpack\src\index.js:13:10) at Module._compile (internal/modules/cjs/loader.js:805:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10) at Module.load (internal/modules/cjs/loader.js:672:32) at tryModuleLoad (internal/modules/cjs/loader.js:612:12) at Function.Module._load (internal/modules/cjs/loader.js:604:3) at Module.require (internal/modules/cjs/loader.js:711:19) at require (internal/modules/cjs/helpers.js:14:16) at Object. (G:\Front-End\angular\rapydly\node_modules@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\typescript.js:4:19) at Module._compile (internal/modules/cjs/loader.js:805:30)

This is my package.json file:

{
  "name": "rapid",
  "version": "1.1.9",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@asymmetrik/ngx-leaflet": "^4.0.0",
    "@dvsl/zoomcharts": "^1.18.4",
    "@ng-bootstrap/ng-bootstrap": "^4.0.3",
    "@types/c3": "^0.6.0",
    "angular-2-dropdown-multiselect": "^1.8.1",
    "angular-confirmation-popover": "^4.2.0",
    "angular-datatables": "^6.0.0",
    "angular2-tag-input": "^1.2.3",
    "angular2-toaster": "^6.1.0",
    "aws-sdk": "^2.271.1",
    "bootstrap": "^3.3.7",
    "bootstrap-daterangepicker": "^3.0.3",
    "c3": "^0.6.6",
    "core-js": "^2.4.1",
    "crypto-js": "^3.1.9-1",
    "datatables.net": "^1.10.18",
    "datatables.net-dt": "^1.10.18",
    "file-saver": "^2.0.0",
    "jquery": "^3.3.1",
    "leaflet": "^1.3.4",
    "moment": "^2.22.2",
    "ng-multiselect-dropdown": "^0.1.9",
    "ng-recaptcha": "^4.2.1",
    "ng2-table": "^1.3.2",
    "ng2-tooltip-directive": "^2.1.6",
    "ngx-bootstrap": "^3.1.2",
    "ngx-cookie-service": "^1.0.10",
    "ngx-popover": "0.0.16",
    "ngx-spinner": "^6.0.0",
    "ngx-tooltip": "0.0.9",
    "ngx-webstorage": "^2.0.1",
    "popper.js": "^1.14.3",
    "rxjs": "^5.5.6",
    "tslib": "^1.9.0",
    "xlsx": "^0.14.1",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.12.4",
    "@angular/cli": "^7.2.1",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/datatables.net": "^1.10.11",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/jquery": "^3.3.4",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^3.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",
    "protractor": "^5.4.0",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

Can some one guide me as to what the issue is to get the error? I am working on the windows platform. I uninstalled the previous node version and installed the new version. Still it's giving the same error.

like image 599
Santhosh Avatar asked Apr 10 '19 06:04

Santhosh


People also ask

What is angular compiler?

The Angular Compiler (which we call ngc ) is the tool used to compile Angular applications and libraries. ngc is built on the TypeScript compiler (called tsc ) and extends the process of compiling TypeScript code to add additional code generation related to Angular's capabilities.

Can't find module angular Devkit build angular?

To solve the error "Could not find module '@angular-devkit/build-angular'", make sure to install the package by opening your terminal in your project's root directory and running the following command: npm i -D @angular-devkit/build-angular and restart your IDE and development server. Copied!

What is angular CLI version?

Angular CLI - The CLI tool for Angular. The sources for this package are in the Angular CLI repository. Please file issues and pull requests against that repository. Usage information and reference details can be found in repository README file. Tip: Click on a version number to view a previous version's package page.


1 Answers

By executing the npm i @angular/compiler-cli everything is again working perfectly.

like image 133
Santhosh Avatar answered Sep 30 '22 17:09

Santhosh