I am using VSCode to edit my react-native code
I have created a new project through CMD and open it in VS code at first when I run it shows me below error
I am not able to rectify it why it is happening I have not changed anything in the project.
C:\Program Files\nodejs\node.exe --inspect-brk=31518 index.android.js
Debugger listening on ws://127.0.0.1:31218/7656dcf9-e5fc-4f01-8b44-c1347348e15d
Debugger attached.
c:\...\reactNative\APPNAME\index.android.js:7
import React, { Component } from 'react';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
Waiting for the debugger to disconnect...
SyntaxError: Unexpected token import
vm.js:80
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
Hot Questions