react-native init project create error import type {CommandT} from './commands' . SyntaxError: Unexpected token import

While creating a new react-native project on a windows machine using the following command react-native init spiderip

Getting the following error message and failed create the project

import type {CommandT} from './commands';
^^^^^^
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 Module._compile (C:\everforms\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (module.js:663:10)
    at Object.newLoader [as .js] (C:\everforms\node_modules\pirates\lib\index.js:96:7)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

It seems to be an issue with the 0.56 version of react-native on Windows.

To solve it you can create a project with another react-native version:

react-native init --version="0.55.4" spiderip

Comments