Cannot find module '@angular/compiler'












5















I run the command npm install -g @angular/cli and after i tried to run my app it says, Cannot find module '@angular/compiler' in the terminal. How can i install the compiler in my package.json in order to compile my application



//package
{
"name": "Restaurant",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "~2.4.9",
"@angular/compiler": "~2.4.9",
"@angular/core": "~2.4.9",
"@angular/forms": "~2.4.9",
"@angular/http": "~2.4.9",
"@angular/platform-browser": "~2.4.9",
"@angular/platform-browser-dynamic": "~2.4.9",
"@angular/router": "~3.4.9",
"@types/lodash": "^4.14.50",
"angular-2-data-table": "^0.1.2",
"angular2-datatable": "^0.5.2",
"core-js": "^2.4.1",
"lodash": "^4.17.4",
"ng2-date-picker": "^0.2.1",
"ng2-file-upload": "^1.1.2",
"ng2-modal": "0.0.25",
"ng2-pagination": "^2.0.1",
"ng2-table": "^1.3.2",
"primeng": "^2.0.1",
"rxjs": "5.2.0",
"tinymce": "^4.5.2",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.7"
},
"devDependencies": {
"@angular/cli": "^1.0.0-rc.1",
"@types/jasmine": "2.2.30",
"@types/node": "^7.0.5",
"angular/cli": "1.0.0-beta.28.3",
"codelyzer": "3.0.0-beta.0",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"karma": "1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "5.1.1",
"ts-node": "2.1.0",
"tslint": "4.5.1",
"typescript": "~2.2.1"
}
}









share|improve this question





























    5















    I run the command npm install -g @angular/cli and after i tried to run my app it says, Cannot find module '@angular/compiler' in the terminal. How can i install the compiler in my package.json in order to compile my application



    //package
    {
    "name": "Restaurant",
    "version": "0.0.0",
    "license": "MIT",
    "angular-cli": {},
    "scripts": {
    "start": "ng serve",
    "lint": "tslint "src/**/*.ts"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
    },
    "private": true,
    "dependencies": {
    "@angular/common": "~2.4.9",
    "@angular/compiler": "~2.4.9",
    "@angular/core": "~2.4.9",
    "@angular/forms": "~2.4.9",
    "@angular/http": "~2.4.9",
    "@angular/platform-browser": "~2.4.9",
    "@angular/platform-browser-dynamic": "~2.4.9",
    "@angular/router": "~3.4.9",
    "@types/lodash": "^4.14.50",
    "angular-2-data-table": "^0.1.2",
    "angular2-datatable": "^0.5.2",
    "core-js": "^2.4.1",
    "lodash": "^4.17.4",
    "ng2-date-picker": "^0.2.1",
    "ng2-file-upload": "^1.1.2",
    "ng2-modal": "0.0.25",
    "ng2-pagination": "^2.0.1",
    "ng2-table": "^1.3.2",
    "primeng": "^2.0.1",
    "rxjs": "5.2.0",
    "tinymce": "^4.5.2",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.7"
    },
    "devDependencies": {
    "@angular/cli": "^1.0.0-rc.1",
    "@types/jasmine": "2.2.30",
    "@types/node": "^7.0.5",
    "angular/cli": "1.0.0-beta.28.3",
    "codelyzer": "3.0.0-beta.0",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.5.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.6.0",
    "protractor": "5.1.1",
    "ts-node": "2.1.0",
    "tslint": "4.5.1",
    "typescript": "~2.2.1"
    }
    }









    share|improve this question



























      5












      5








      5


      2






      I run the command npm install -g @angular/cli and after i tried to run my app it says, Cannot find module '@angular/compiler' in the terminal. How can i install the compiler in my package.json in order to compile my application



      //package
      {
      "name": "Restaurant",
      "version": "0.0.0",
      "license": "MIT",
      "angular-cli": {},
      "scripts": {
      "start": "ng serve",
      "lint": "tslint "src/**/*.ts"",
      "test": "ng test",
      "pree2e": "webdriver-manager update",
      "e2e": "protractor"
      },
      "private": true,
      "dependencies": {
      "@angular/common": "~2.4.9",
      "@angular/compiler": "~2.4.9",
      "@angular/core": "~2.4.9",
      "@angular/forms": "~2.4.9",
      "@angular/http": "~2.4.9",
      "@angular/platform-browser": "~2.4.9",
      "@angular/platform-browser-dynamic": "~2.4.9",
      "@angular/router": "~3.4.9",
      "@types/lodash": "^4.14.50",
      "angular-2-data-table": "^0.1.2",
      "angular2-datatable": "^0.5.2",
      "core-js": "^2.4.1",
      "lodash": "^4.17.4",
      "ng2-date-picker": "^0.2.1",
      "ng2-file-upload": "^1.1.2",
      "ng2-modal": "0.0.25",
      "ng2-pagination": "^2.0.1",
      "ng2-table": "^1.3.2",
      "primeng": "^2.0.1",
      "rxjs": "5.2.0",
      "tinymce": "^4.5.2",
      "ts-helpers": "^1.1.1",
      "zone.js": "^0.7.7"
      },
      "devDependencies": {
      "@angular/cli": "^1.0.0-rc.1",
      "@types/jasmine": "2.2.30",
      "@types/node": "^7.0.5",
      "angular/cli": "1.0.0-beta.28.3",
      "codelyzer": "3.0.0-beta.0",
      "jasmine-core": "2.5.2",
      "jasmine-spec-reporter": "3.2.0",
      "karma": "1.5.0",
      "karma-chrome-launcher": "^2.0.0",
      "karma-cli": "^1.0.1",
      "karma-jasmine": "^1.0.2",
      "karma-remap-istanbul": "^0.6.0",
      "protractor": "5.1.1",
      "ts-node": "2.1.0",
      "tslint": "4.5.1",
      "typescript": "~2.2.1"
      }
      }









      share|improve this question
















      I run the command npm install -g @angular/cli and after i tried to run my app it says, Cannot find module '@angular/compiler' in the terminal. How can i install the compiler in my package.json in order to compile my application



      //package
      {
      "name": "Restaurant",
      "version": "0.0.0",
      "license": "MIT",
      "angular-cli": {},
      "scripts": {
      "start": "ng serve",
      "lint": "tslint "src/**/*.ts"",
      "test": "ng test",
      "pree2e": "webdriver-manager update",
      "e2e": "protractor"
      },
      "private": true,
      "dependencies": {
      "@angular/common": "~2.4.9",
      "@angular/compiler": "~2.4.9",
      "@angular/core": "~2.4.9",
      "@angular/forms": "~2.4.9",
      "@angular/http": "~2.4.9",
      "@angular/platform-browser": "~2.4.9",
      "@angular/platform-browser-dynamic": "~2.4.9",
      "@angular/router": "~3.4.9",
      "@types/lodash": "^4.14.50",
      "angular-2-data-table": "^0.1.2",
      "angular2-datatable": "^0.5.2",
      "core-js": "^2.4.1",
      "lodash": "^4.17.4",
      "ng2-date-picker": "^0.2.1",
      "ng2-file-upload": "^1.1.2",
      "ng2-modal": "0.0.25",
      "ng2-pagination": "^2.0.1",
      "ng2-table": "^1.3.2",
      "primeng": "^2.0.1",
      "rxjs": "5.2.0",
      "tinymce": "^4.5.2",
      "ts-helpers": "^1.1.1",
      "zone.js": "^0.7.7"
      },
      "devDependencies": {
      "@angular/cli": "^1.0.0-rc.1",
      "@types/jasmine": "2.2.30",
      "@types/node": "^7.0.5",
      "angular/cli": "1.0.0-beta.28.3",
      "codelyzer": "3.0.0-beta.0",
      "jasmine-core": "2.5.2",
      "jasmine-spec-reporter": "3.2.0",
      "karma": "1.5.0",
      "karma-chrome-launcher": "^2.0.0",
      "karma-cli": "^1.0.1",
      "karma-jasmine": "^1.0.2",
      "karma-remap-istanbul": "^0.6.0",
      "protractor": "5.1.1",
      "ts-node": "2.1.0",
      "tslint": "4.5.1",
      "typescript": "~2.2.1"
      }
      }






      angular






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 '18 at 14:41









      Francesco Borzi

      14.4k95185




      14.4k95185










      asked Mar 3 '17 at 18:06









      Liska LiskorLiska Liskor

      4813917




      4813917
























          5 Answers
          5






          active

          oldest

          votes


















          14














          Try to delete that "angular/cli": "1.0.0-beta.28.3", in the devDependencies it is useless , and add instead of it "@angular/compiler-cli": "^2.3.1", (since it is the current version, else add it by npm i --save-dev @angular/compiler-cli ), then in your root app folder run those commands:





          1. rm -r node_modules (or delete your node_modules folder manually)


          2. npm cache clean (doesnt not work in npm v5)

          3. npm install






          share|improve this answer

































            5














            I just run npm install and then ok.






            share|improve this answer































              1














              npm install --save-dev @angular/cli@latest this command is working fine for me ubuntu 16.04 lts






              share|improve this answer































                1














                Just to add to this. You will get this error too, when you are running ng serve not from within your project folder. So always make sure your bash runs from your project folder.






                share|improve this answer































                  0














                  Try this




                  1. npm uninstall angular-cli

                  2. npm install @angular/cli --save-dev






                  share|improve this answer























                    Your Answer






                    StackExchange.ifUsing("editor", function () {
                    StackExchange.using("externalEditor", function () {
                    StackExchange.using("snippets", function () {
                    StackExchange.snippets.init();
                    });
                    });
                    }, "code-snippets");

                    StackExchange.ready(function() {
                    var channelOptions = {
                    tags: "".split(" "),
                    id: "1"
                    };
                    initTagRenderer("".split(" "), "".split(" "), channelOptions);

                    StackExchange.using("externalEditor", function() {
                    // Have to fire editor after snippets, if snippets enabled
                    if (StackExchange.settings.snippets.snippetsEnabled) {
                    StackExchange.using("snippets", function() {
                    createEditor();
                    });
                    }
                    else {
                    createEditor();
                    }
                    });

                    function createEditor() {
                    StackExchange.prepareEditor({
                    heartbeatType: 'answer',
                    autoActivateHeartbeat: false,
                    convertImagesToLinks: true,
                    noModals: true,
                    showLowRepImageUploadWarning: true,
                    reputationToPostImages: 10,
                    bindNavPrevention: true,
                    postfix: "",
                    imageUploader: {
                    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                    allowUrls: true
                    },
                    onDemand: true,
                    discardSelector: ".discard-answer"
                    ,immediatelyShowMarkdownHelp:true
                    });


                    }
                    });














                    draft saved

                    draft discarded


















                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42585663%2fcannot-find-module-angular-compiler%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown

























                    5 Answers
                    5






                    active

                    oldest

                    votes








                    5 Answers
                    5






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes









                    14














                    Try to delete that "angular/cli": "1.0.0-beta.28.3", in the devDependencies it is useless , and add instead of it "@angular/compiler-cli": "^2.3.1", (since it is the current version, else add it by npm i --save-dev @angular/compiler-cli ), then in your root app folder run those commands:





                    1. rm -r node_modules (or delete your node_modules folder manually)


                    2. npm cache clean (doesnt not work in npm v5)

                    3. npm install






                    share|improve this answer






























                      14














                      Try to delete that "angular/cli": "1.0.0-beta.28.3", in the devDependencies it is useless , and add instead of it "@angular/compiler-cli": "^2.3.1", (since it is the current version, else add it by npm i --save-dev @angular/compiler-cli ), then in your root app folder run those commands:





                      1. rm -r node_modules (or delete your node_modules folder manually)


                      2. npm cache clean (doesnt not work in npm v5)

                      3. npm install






                      share|improve this answer




























                        14












                        14








                        14







                        Try to delete that "angular/cli": "1.0.0-beta.28.3", in the devDependencies it is useless , and add instead of it "@angular/compiler-cli": "^2.3.1", (since it is the current version, else add it by npm i --save-dev @angular/compiler-cli ), then in your root app folder run those commands:





                        1. rm -r node_modules (or delete your node_modules folder manually)


                        2. npm cache clean (doesnt not work in npm v5)

                        3. npm install






                        share|improve this answer















                        Try to delete that "angular/cli": "1.0.0-beta.28.3", in the devDependencies it is useless , and add instead of it "@angular/compiler-cli": "^2.3.1", (since it is the current version, else add it by npm i --save-dev @angular/compiler-cli ), then in your root app folder run those commands:





                        1. rm -r node_modules (or delete your node_modules folder manually)


                        2. npm cache clean (doesnt not work in npm v5)

                        3. npm install







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Nov 14 '18 at 21:47

























                        answered Mar 3 '17 at 18:52









                        selem mnselem mn

                        5,10541939




                        5,10541939

























                            5














                            I just run npm install and then ok.






                            share|improve this answer




























                              5














                              I just run npm install and then ok.






                              share|improve this answer


























                                5












                                5








                                5







                                I just run npm install and then ok.






                                share|improve this answer













                                I just run npm install and then ok.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Dec 4 '17 at 21:25









                                Lasith NiroshanLasith Niroshan

                                14939




                                14939























                                    1














                                    npm install --save-dev @angular/cli@latest this command is working fine for me ubuntu 16.04 lts






                                    share|improve this answer




























                                      1














                                      npm install --save-dev @angular/cli@latest this command is working fine for me ubuntu 16.04 lts






                                      share|improve this answer


























                                        1












                                        1








                                        1







                                        npm install --save-dev @angular/cli@latest this command is working fine for me ubuntu 16.04 lts






                                        share|improve this answer













                                        npm install --save-dev @angular/cli@latest this command is working fine for me ubuntu 16.04 lts







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Aug 31 '17 at 7:41









                                        AkalyvanAkalyvan

                                        47112




                                        47112























                                            1














                                            Just to add to this. You will get this error too, when you are running ng serve not from within your project folder. So always make sure your bash runs from your project folder.






                                            share|improve this answer




























                                              1














                                              Just to add to this. You will get this error too, when you are running ng serve not from within your project folder. So always make sure your bash runs from your project folder.






                                              share|improve this answer


























                                                1












                                                1








                                                1







                                                Just to add to this. You will get this error too, when you are running ng serve not from within your project folder. So always make sure your bash runs from your project folder.






                                                share|improve this answer













                                                Just to add to this. You will get this error too, when you are running ng serve not from within your project folder. So always make sure your bash runs from your project folder.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Oct 30 '17 at 10:23









                                                KarlKarl

                                                111




                                                111























                                                    0














                                                    Try this




                                                    1. npm uninstall angular-cli

                                                    2. npm install @angular/cli --save-dev






                                                    share|improve this answer




























                                                      0














                                                      Try this




                                                      1. npm uninstall angular-cli

                                                      2. npm install @angular/cli --save-dev






                                                      share|improve this answer


























                                                        0












                                                        0








                                                        0







                                                        Try this




                                                        1. npm uninstall angular-cli

                                                        2. npm install @angular/cli --save-dev






                                                        share|improve this answer













                                                        Try this




                                                        1. npm uninstall angular-cli

                                                        2. npm install @angular/cli --save-dev







                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered Jan 2 at 21:32









                                                        Rahul VermaRahul Verma

                                                        2218




                                                        2218






























                                                            draft saved

                                                            draft discarded




















































                                                            Thanks for contributing an answer to Stack Overflow!


                                                            • Please be sure to answer the question. Provide details and share your research!

                                                            But avoid



                                                            • Asking for help, clarification, or responding to other answers.

                                                            • Making statements based on opinion; back them up with references or personal experience.


                                                            To learn more, see our tips on writing great answers.




                                                            draft saved


                                                            draft discarded














                                                            StackExchange.ready(
                                                            function () {
                                                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42585663%2fcannot-find-module-angular-compiler%23new-answer', 'question_page');
                                                            }
                                                            );

                                                            Post as a guest















                                                            Required, but never shown





















































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown

































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown







                                                            Popular posts from this blog

                                                            Florida Star v. B. J. F.

                                                            Danny Elfman

                                                            Lugert, Oklahoma