Syntax error on vm.js when running react app











up vote
0
down vote

favorite












I created a basic react-app with "npm install -g create-react-app" and then "create-react-app my-app".



After entering "npm start" into my command line, the localhost view is still available, but runninmg the app.js in Visual Studio Code leads to that error:



C:Program Filesnodejsnode.exe --inspect-brk=37970 srcApp.js 
Debugger listening on ws://127.0.0.1:37970/b058e445-c99e-4b27-bb5d-


3477c4edc040
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
c:Users......srcApp.js:1
(function (exports, require, module, __filename, __dirname) { import React,
{ Component } from 'react';
^^^^^



SyntaxError: Unexpected identifier
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)


So, my new app is just a default app, which leads me to believe that something is not adjusted the right way on my computer system.



Before I tried to run a default app, I created another app with a little content, which was running first, but then after submitting it to git and github and restarting the computer it didn't work anymore, with exactly the same error message. That app, after entering "npm start", wouldn't even cause the localhost to start.



Does anyone of you have an idea what could cause this problem?



I appreciate any hint.



Thank you!










share|improve this question







New contributor




mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    0
    down vote

    favorite












    I created a basic react-app with "npm install -g create-react-app" and then "create-react-app my-app".



    After entering "npm start" into my command line, the localhost view is still available, but runninmg the app.js in Visual Studio Code leads to that error:



    C:Program Filesnodejsnode.exe --inspect-brk=37970 srcApp.js 
    Debugger listening on ws://127.0.0.1:37970/b058e445-c99e-4b27-bb5d-


    3477c4edc040
    For help, see: https://nodejs.org/en/docs/inspector
    Debugger attached.
    c:Users......srcApp.js:1
    (function (exports, require, module, __filename, __dirname) { import React,
    { Component } from 'react';
    ^^^^^



    SyntaxError: Unexpected identifier
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:656:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)


    So, my new app is just a default app, which leads me to believe that something is not adjusted the right way on my computer system.



    Before I tried to run a default app, I created another app with a little content, which was running first, but then after submitting it to git and github and restarting the computer it didn't work anymore, with exactly the same error message. That app, after entering "npm start", wouldn't even cause the localhost to start.



    Does anyone of you have an idea what could cause this problem?



    I appreciate any hint.



    Thank you!










    share|improve this question







    New contributor




    mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I created a basic react-app with "npm install -g create-react-app" and then "create-react-app my-app".



      After entering "npm start" into my command line, the localhost view is still available, but runninmg the app.js in Visual Studio Code leads to that error:



      C:Program Filesnodejsnode.exe --inspect-brk=37970 srcApp.js 
      Debugger listening on ws://127.0.0.1:37970/b058e445-c99e-4b27-bb5d-


      3477c4edc040
      For help, see: https://nodejs.org/en/docs/inspector
      Debugger attached.
      c:Users......srcApp.js:1
      (function (exports, require, module, __filename, __dirname) { import React,
      { Component } from 'react';
      ^^^^^



      SyntaxError: Unexpected identifier
      at new Script (vm.js:79:7)
      at createScript (vm.js:251:10)
      at Object.runInThisContext (vm.js:303:10)
      at Module._compile (internal/modules/cjs/loader.js:656:28)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
      at Module.load (internal/modules/cjs/loader.js:598:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
      at Function.Module._load (internal/modules/cjs/loader.js:529:3)
      at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
      at startup (internal/bootstrap/node.js:285:19)


      So, my new app is just a default app, which leads me to believe that something is not adjusted the right way on my computer system.



      Before I tried to run a default app, I created another app with a little content, which was running first, but then after submitting it to git and github and restarting the computer it didn't work anymore, with exactly the same error message. That app, after entering "npm start", wouldn't even cause the localhost to start.



      Does anyone of you have an idea what could cause this problem?



      I appreciate any hint.



      Thank you!










      share|improve this question







      New contributor




      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I created a basic react-app with "npm install -g create-react-app" and then "create-react-app my-app".



      After entering "npm start" into my command line, the localhost view is still available, but runninmg the app.js in Visual Studio Code leads to that error:



      C:Program Filesnodejsnode.exe --inspect-brk=37970 srcApp.js 
      Debugger listening on ws://127.0.0.1:37970/b058e445-c99e-4b27-bb5d-


      3477c4edc040
      For help, see: https://nodejs.org/en/docs/inspector
      Debugger attached.
      c:Users......srcApp.js:1
      (function (exports, require, module, __filename, __dirname) { import React,
      { Component } from 'react';
      ^^^^^



      SyntaxError: Unexpected identifier
      at new Script (vm.js:79:7)
      at createScript (vm.js:251:10)
      at Object.runInThisContext (vm.js:303:10)
      at Module._compile (internal/modules/cjs/loader.js:656:28)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
      at Module.load (internal/modules/cjs/loader.js:598:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
      at Function.Module._load (internal/modules/cjs/loader.js:529:3)
      at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
      at startup (internal/bootstrap/node.js:285:19)


      So, my new app is just a default app, which leads me to believe that something is not adjusted the right way on my computer system.



      Before I tried to run a default app, I created another app with a little content, which was running first, but then after submitting it to git and github and restarting the computer it didn't work anymore, with exactly the same error message. That app, after entering "npm start", wouldn't even cause the localhost to start.



      Does anyone of you have an idea what could cause this problem?



      I appreciate any hint.



      Thank you!







      javascript reactjs npm create-react-app






      share|improve this question







      New contributor




      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Nov 21 at 12:41









      mats

      1




      1




      New contributor




      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      mats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





























          active

          oldest

          votes











          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',
          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
          });


          }
          });






          mats is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412258%2fsyntax-error-on-vm-js-when-running-react-app%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          mats is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          mats is a new contributor. Be nice, and check out our Code of Conduct.













          mats is a new contributor. Be nice, and check out our Code of Conduct.












          mats is a new contributor. Be nice, and check out our Code of Conduct.















           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412258%2fsyntax-error-on-vm-js-when-running-react-app%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

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks