I have been following this tutorial, but there is one section that I don’t understand. It’s this bit:
“In this tutorial we will be using the SAFE Browser package that is built to work with the mock network. So please go ahead and download the one corresponding for your platform, and unzip the package in your PC. Before we launch it let’s go ahead and set the NODE_ENV environment variable set to dev to have our browser to effectively use the native libraries for mock routing:
$ export NODE_ENV=dev
You can now launch the browser (make sure you launch it from the same console where you just set the NODE_ENV variable)”
I have downloaded and unzipped ‘safe-browser-mock-v0.10.2-win-x64’.
But now I am just guessing. Am I setting the environment variable using Git Bash? It doesn’t say.
If so do I right click on the ‘safe-browser-mock-v0.10.2-win-x64’ folder, select Git Bash here and run $ export NODE_ENV=dev? When I try this, I get no errors, but I don’t know if it has worked.
Then I have to “make sure you launch it from the same console where you just set the NODE_ENV variable”. How do I do that?
I’m not familiar with git bash so can’t help with that atm, but the instructions in the tutorial assume you are starting the browser from the command line, not using a right-click. So that means that rather than ‘right-click’ you would:
download the browser
extract the files
make sure the browser file is executable. You don’t say what operating system you are using so I can’t give precise instructions for this or what follows…
open a terminal (ie command line).
to run the browser on Linux, if the browser executable file is safe_browser you would then type the following on the terminal command line:
NODE_ENV=dev ./safe_browser
Or as in the tutorial you can type:
export NODE_ENV=dev
./safe_browser
@DGeddes I think it would help if the tutorial showed this, or provided a direct link to instructions on how to download, install and then run the browser with NODE_ENV set.
Using Git Bash you’ve done it perfectly well. Git Bash is basically Unix/Linux. The ‘same console’ means launching the executable it from the same Git Bash window in this case:
$ export NODE_ENV=dev # set the variable
$ "./SAFE Browser.exe" # or ./SAFE\ Browser.exe due to space
Make sure you’re in the same directory as the SAFE Browser executable.