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

cannot use import statement outside a module #21

Open
saranda-2811 opened this issue Aug 9, 2020 · 1 comment
Open

cannot use import statement outside a module #21

saranda-2811 opened this issue Aug 9, 2020 · 1 comment

Comments

@saranda-2811
Copy link

I run react-native run-android in cmd, after changing path to the project folder, but it shows the following error:

import type {CommandT} from './commands';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1117:16)
at Module._compile (internal/modules/cjs/loader.js:1165:27)
at Module._compile (C:\Users\saran\react-native-airbnb-clone\node_modules\pirates\lib\index.js:91:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
at Object.newLoader [as .js] (C:\Users\saran\react-native-airbnb-clone\node_modules\pirates\lib\index.js:96:7)
at Module.load (internal/modules/cjs/loader.js:1050:32)
at Function.Module._load (internal/modules/cjs/loader.js:938:14)
at Module.require (internal/modules/cjs/loader.js:1090:19)
at require (internal/modules/cjs/helpers.js:75:18)
at Object. (C:\Users\saran\react-native-airbnb-clone\node_modules\react-native\local-cli\cli.js:21:16)

@saranda-2811
Copy link
Author

Well, I solved this error after some time.
It seemed that a I didn't have a lot of dependencies installed. So, in order to save your time, stop installing them manually, and just run 'npm audit fix'. (or you could use with --force)
This will fix all dependencies, and your app should run after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant