Jake Xuereb
Jake Xuereb

Reputation: 223

Error in React Native Node.JS compilation

I am trying to compile a react native guide which allows one to create forms available here : - https://github.com/smhatre59/cloudstorage

When attempting to compile using the "npm run-script build" or even for development using "npm start" the screen loads and then crashes to the following errors.

> [email protected] build C:\Users\Jake\command line 
work\LearnD\IterReact\cloudstorage-master\cloudstorage-master\frontend
> react-scripts build

Creating an optimized production build...
Failed to compile.

./src/App.js
Line 7:   Import in body of module; reorder to top  import/first
Line 8:   Import in body of module; reorder to top  import/first
Line 9:   Import in body of module; reorder to top  import/first
Line 10:  Import in body of module; reorder to top  import/first

Search for the keywords to learn more about each error.


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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:
npm ERR!     C:\Users\Jake\AppData\Roaming\npm-cache\_logs\2017-08-
21T11_44_10_407Z-debug.log

enter image description here

The corresponding code may be found in its entirety in the aforementioned repo or more readily for the corresponding file in this gist : https://gist.github.com/jqed-xuereb/9ab5f947a0a9906ec0d1cba91927859b.

Thanks in advance, J

Upvotes: 1

Views: 600

Answers (1)

Teedub
Teedub

Reputation: 382

In your App.js code, you need to move all import statements to the top.

Currently you have injectTapEventPlugin(); between the list of import statements and this is causing the error.

Upvotes: 3

Related Questions