OpenAgricultureFoundation / openag_ui

UI for OpenAg food computers
GNU General Public License v3.0
53 stars 27 forks source link

Not Runnin in NodeJs6 #123

Closed himadriganguly closed 7 years ago

himadriganguly commented 7 years ago

When running app.js under scripts using node app.js

It gives error

(function (exports, require, module, filename, dirname) { import {html, forward, Effects, thunk} from 'reflex'; ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:509:3

gordonbrander commented 7 years ago

@himadriganguly running node app.js isn't supported. See README.md for instructions. The Node tools are basically just there to compile modules into a single file. The compiled app is a single file with no server.

himadriganguly commented 7 years ago

Ok then really sorry for opening the issue.

But can you please tell me how to run it on localhost? As "The web or IP address of your Food Computer" is not taking the IP of the localhost.

gordonbrander commented 7 years ago

@himadriganguly No problem! You can download the built files on the releases page https://github.com/OpenAgInitiative/openag_ui/releases.

You can drag/drop the index.html on to your browser. You'll want to make sure that your laptop and the Food Computer are on the same network.

himadriganguly commented 7 years ago

I don't have the food computer currently. But can't I run it on my localhost for any development or just to check out the interface?

gordonbrander commented 7 years ago

@himadriganguly the backend is built on ROS and runs on the Raspberry Pi. If you have an Arduino and a Raspberry Pi, you can run the backend on top of them. I do this for testing. However, the software won't do much without sensors or actuators.

You can find more info here http://wiki.openag.media.mit.edu/openag/food_computer_2.0/food_computer_2.0.

himadriganguly commented 7 years ago

Ok great. Thanks a lot for the help. I am planning to build a Food Computer some time soon.

If I face any issue I will definitely contacting you or posting it in the forum.

Wish you all the best for the good work. Keep it up bro.