The problem is that Johnny Five (J5) cannot be initially launched from the browser. J5 needs access to ports on your computer that the browser (for security reasons) does not allow. My theory is that when you say that you are running βreagent-free,β you launch the NodeJS console (rather than just deleting part of the React code and re-launching it in the browser). NodeJS applications run in a different context, and then in browser scripts.
So how do you achieve your goal? You have a couple of options that I can think of.
Option 1:
First write the NodeJS Desktop app. Desktop applications provide you with the necessary runtime context (access to ports) by providing you with the graphical user interface (GUI) you were hoping for with a web application. You can do this using Node Webkit , AppJS, or several others (Google Apps NodeJS Desktop only). The great thing about these desktop applications is the graphical interface written in HTML and CSS. So it's just like a web page, it just doesn't launch in the browser (or the browser you expect).
Option 2:
Maybe you really need a web application (maybe you need a web page that others can access and manage your Johnny Five bot). In this case, you will need to write two systems. The first is the web client (with which you have already worked with your React code). The web client will not have the Johnny Five code. The second system you will need to write is a web server. The server will process all Johnny Five code. Your client will have an interface (buttons, text inputs, etc.). When the user clicks the button, you send a request to the server. The server processes this request, calling the correct Johnny Five code. An extremely simplified example is given here.
source share