ng serve : Cannot find module './templates.js'












0















I just transfered my Angular 6 project from one computer to another and in the new device I get the following error when trying to ng serve



I have also tried with npm install templates.js , the dependency is installed but this error pops again



Cannot find module './templates.js'
Error: Cannot find module './templates.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_moduleschalkindex.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_modulespostcsslibcss-syntax-error.js:9:14)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)


This could be similar to ng serve: Cannot find module 'tapable'



Thanks in Advance :)










share|improve this question

























  • Did you import it at the beginning where you are consuming it?

    – Shivaraj
    Nov 19 '18 at 21:59











  • no , can you tell how to import it

    – Godwin
    Nov 20 '18 at 6:56
















0















I just transfered my Angular 6 project from one computer to another and in the new device I get the following error when trying to ng serve



I have also tried with npm install templates.js , the dependency is installed but this error pops again



Cannot find module './templates.js'
Error: Cannot find module './templates.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_moduleschalkindex.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_modulespostcsslibcss-syntax-error.js:9:14)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)


This could be similar to ng serve: Cannot find module 'tapable'



Thanks in Advance :)










share|improve this question

























  • Did you import it at the beginning where you are consuming it?

    – Shivaraj
    Nov 19 '18 at 21:59











  • no , can you tell how to import it

    – Godwin
    Nov 20 '18 at 6:56














0












0








0








I just transfered my Angular 6 project from one computer to another and in the new device I get the following error when trying to ng serve



I have also tried with npm install templates.js , the dependency is installed but this error pops again



Cannot find module './templates.js'
Error: Cannot find module './templates.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_moduleschalkindex.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_modulespostcsslibcss-syntax-error.js:9:14)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)


This could be similar to ng serve: Cannot find module 'tapable'



Thanks in Advance :)










share|improve this question
















I just transfered my Angular 6 project from one computer to another and in the new device I get the following error when trying to ng serve



I have also tried with npm install templates.js , the dependency is installed but this error pops again



Cannot find module './templates.js'
Error: Cannot find module './templates.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_moduleschalkindex.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:UsersGodwinDesktoplivigronode_modulespostcsslibcss-syntax-error.js:9:14)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)


This could be similar to ng serve: Cannot find module 'tapable'



Thanks in Advance :)







node.js angular angular6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 7:45







Godwin

















asked Nov 19 '18 at 21:20









GodwinGodwin

1158




1158













  • Did you import it at the beginning where you are consuming it?

    – Shivaraj
    Nov 19 '18 at 21:59











  • no , can you tell how to import it

    – Godwin
    Nov 20 '18 at 6:56



















  • Did you import it at the beginning where you are consuming it?

    – Shivaraj
    Nov 19 '18 at 21:59











  • no , can you tell how to import it

    – Godwin
    Nov 20 '18 at 6:56

















Did you import it at the beginning where you are consuming it?

– Shivaraj
Nov 19 '18 at 21:59





Did you import it at the beginning where you are consuming it?

– Shivaraj
Nov 19 '18 at 21:59













no , can you tell how to import it

– Godwin
Nov 20 '18 at 6:56





no , can you tell how to import it

– Godwin
Nov 20 '18 at 6:56












2 Answers
2






active

oldest

votes


















1














It can occur for two reasons:



1. templates.js is not present.
2. templates.js is present but you provided the wrong relative path.


Kindly check once. And you don't need to install "templates.js" if it's not an external package. Npm install is used for installing the external packages.






share|improve this answer































    1














    Removing the node_modules folder and again using npm install solves the problem , and the ng serve working good






    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%2f53382792%2fng-serve-cannot-find-module-templates-js%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      It can occur for two reasons:



      1. templates.js is not present.
      2. templates.js is present but you provided the wrong relative path.


      Kindly check once. And you don't need to install "templates.js" if it's not an external package. Npm install is used for installing the external packages.






      share|improve this answer




























        1














        It can occur for two reasons:



        1. templates.js is not present.
        2. templates.js is present but you provided the wrong relative path.


        Kindly check once. And you don't need to install "templates.js" if it's not an external package. Npm install is used for installing the external packages.






        share|improve this answer


























          1












          1








          1







          It can occur for two reasons:



          1. templates.js is not present.
          2. templates.js is present but you provided the wrong relative path.


          Kindly check once. And you don't need to install "templates.js" if it's not an external package. Npm install is used for installing the external packages.






          share|improve this answer













          It can occur for two reasons:



          1. templates.js is not present.
          2. templates.js is present but you provided the wrong relative path.


          Kindly check once. And you don't need to install "templates.js" if it's not an external package. Npm install is used for installing the external packages.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 8:07









          Biplab MalakarBiplab Malakar

          41837




          41837

























              1














              Removing the node_modules folder and again using npm install solves the problem , and the ng serve working good






              share|improve this answer




























                1














                Removing the node_modules folder and again using npm install solves the problem , and the ng serve working good






                share|improve this answer


























                  1












                  1








                  1







                  Removing the node_modules folder and again using npm install solves the problem , and the ng serve working good






                  share|improve this answer













                  Removing the node_modules folder and again using npm install solves the problem , and the ng serve working good







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 20 '18 at 8:29









                  GodwinGodwin

                  1158




                  1158






























                      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%2f53382792%2fng-serve-cannot-find-module-templates-js%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

                      Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                      ComboBox Display Member on multiple fields

                      Is it possible to collect Nectar points via Trainline?