Skip to content

Unable to use 'react-native-init {project}' (error) #20039

Closed
@alexharrisdcj

Description

@alexharrisdcj

I've been using React Native for a few weeks now, working through several learning projects.

However, I'm no longer able to init a new project, as I get the following error. I've used the init command as recently as a few days ago. Any ideas?

C:\ReactNative\{project}\node_modules\react-native\local-cli\cliEntry.js:30
import type {CommandT} from './commands';
^^^^^^

SyntaxError: Unexpected token import
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (module.js:613:28)
    at Module._compile (C:\ReactNative\manager3\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (module.js:660:10)
    at Object.newLoader [as .js] (C:\ReactNative\manager3\node_modules\pirates\lib\index.js:96:7)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions