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

Issue with the setup script #95

Open
siddhanth339 opened this issue Apr 15, 2021 · 10 comments
Open

Issue with the setup script #95

siddhanth339 opened this issue Apr 15, 2021 · 10 comments

Comments

@siddhanth339
Copy link
Contributor

Describe the bug
I was following the instructions on using setup script to initialize the project. I have the Distro, Caracal, and caMicroscope repositories in the same parent folder. When I run "bash ./setup_script.sh", I get an error saying the mongo path was not found while I have set the path inside environment variables.

To Reproduce
Steps to reproduce the behavior:

  1. Open Git bash
  2. Navigate to the Caracal folder which has the "setup_script.sh" file
  3. Run the script with "bash ./setup_script.sh"
  4. See the error

Expected behavior
The script must run smoothly and start the application

Screenshots
The error:
mongoPathError

My environment variables window:
env variables

System information:

  • Device: LENOVO_MT_81DE_BU_idea_FM_ideapad 330-15IKB
  • Processor: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz, 1800 Mhz, 4 Core(s), 8 Logical Processor(s)
  • OS: Microsoft Windows 10 Home
  • Browser: Chrome
  • Version: 10.0.19041 Build 19041
@birm
Copy link
Member

birm commented Apr 15, 2021

so, it looks like your mingw environment doesn't know about mongo, at least as "mongo", or perhaps it's some quirk of mingw's shell?
To help answer this, could you run mongo from mingw and see if it runs?

@siddhanth339
Copy link
Contributor Author

It says: "bash: mongo: command not found"

@YashKumarVerma
Copy link
Contributor

thanks for the detailed report @siddhanth339, could you try navigating to the MongoDB installation directory from the terminal and run ./mongo? What does it show?

Also, is it possible to share the list of variables on your PATH from your terminal?

I'm not currently logged into my windows machine, will try doing so tomorrow morning.

@siddhanth339
Copy link
Contributor Author

Running mongo, I was successfully able to enter into the MongoDB shell:
runMongo

List of variables on my path:
envOnCmd

@YashKumarVerma
Copy link
Contributor

@siddhanth339 since you're running the setup script the cygwin terminal, please run ./mongo and list the path from that shell itself.

@siddhanth339
Copy link
Contributor Author

MongoFrombashShell

pathFromGitBash

@siddhanth339
Copy link
Contributor Author

@YashKumarVerma any update?

@YashKumarVerma
Copy link
Contributor

Apologies but I'm writing university exams this week so was not able to investigate this myself.

@siddhanth339
Copy link
Contributor Author

Update:
When I was looking at the setup script there were few commands using wget So, I installed wget and updated my environment variable "Path" to include wget.
Now, magically, the "mongo path error" I was getting before disappeared.
Any reason why and how this happened?
Is mongo linked with wget in any way?

After successfully running the setup_script, running npm start also runs fine but when I go to localhost:4010, it says "Cannot Get /"

runSetupScript

npmStart

@YashKumarVerma
Copy link
Contributor

It is fairly strange that installing wget solved that problem, but it did nonetheless. The logic for checking whether or not mongo is available in the path or not is (given below). I will play around with this weekend and let you know about the results.

###
## check if the system has required services installed
###
if ! command -v "mongo" &>/dev/null; then
    echo "mongo could not be found on path. Please ensure that mongo is installed and is on PATH"
    exit
fi

if ! command -v "node" &>/dev/null; then
    echo "node could not be found on path. Please ensure that node is installed and is on PATH"
    exit
fi

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

3 participants