1

I am getting following error while building Android Application. Can anyone explain why it is happening

    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 (E:\React_Project\OneTap\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (E:\React_Project\OneTap\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)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

1 Answer 1

2

Based on this GitHub Issue it looks like this is a problem related to RN 0.56 in Windows. As a workaround I would recommend using version 0.55.4.

Sign up to request clarification or add additional context in comments.

2 Comments

I did that I build React project with react-native init {proj_name} --version [email protected] the project created when I run npm start it giving me same error
Ok I got why I am facing issue because when I build project using react-native init {proj_name} --version [email protected] the I used to fire npm audit and npm audit fix to close vulnerabilities that cause me throw same error mention above. Without fix I am able to build project. Thanks !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.