Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use react-native init to create new project #20086

Closed
3 tasks done
salmanfarisvp opened this issue Jul 7, 2018 · 3 comments
Closed
3 tasks done

Can't use react-native init to create new project #20086

salmanfarisvp opened this issue Jul 7, 2018 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@salmanfarisvp
Copy link

Environment

Run react-native info in your terminal and paste its contents here.

C:\Users\Faris\Desktop\learn\reactNative\AwesomeProject\node_modules\react-native\local-cli\cliEntry.js:30
import type {CommandT} from './commands';
       ^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:74:7)
    at createScript (vm.js:246:10)
    at Object.runInThisContext (vm.js:298:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._compile (C:\Users\Faris\Desktop\learn\reactNative\AwesomeProject\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (C:\Users\Faris\Desktop\learn\reactNative\AwesomeProject\node_modules\pirates\lib\index.js:96:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

Description

react-native init {someproject}

to create a new project to work. this is what appear in the console

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 (D:\Works\Project2\node_modules\pirates\lib\index.js:91:24)
at Module._extensions..js (module.js:660:10)
at Object.newLoader [as .js] (D:\Works\Project2\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)

Reproducible Demo

react-native init {someproject}

#20037 :- Can't use react-native init to create new project

Machine :- Windows 10 8GB RAM
Node Version :- v10.6..0

@salmanfarisvp
Copy link
Author

It was solved by react-native init --version="0.55.4" {projectName} , but i think it's a bug

@victorhugoweb
Copy link

React 0.56 doesn't work in Windows ;(
nobody tested in Windows before this release
so sad ;(

@sadiqkhoja
Copy link

any updates on this?

@facebook facebook locked as resolved and limited conversation to collaborators Jul 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants