Skip to content

Dev logs

These pages contain the raw-ish output of various experiments (think console output).

2017-10-15 Bootstrapping an Angular app

First, ensure MongoDB has been set-up (see previous log). Next, we need the CLI tools for Angular. We’ll Node that…

  • npm install -g @angular/cli
  • ng new application-name (this may take a while)
  • cd application-name
  • npm install
  • ng serve
  • Now if everything is working ok, we can hit the default localhost:4200 and see the default app

Installing MongoDB on macOS High Sierra

  • https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition
  • curl -O https://fastdl.mongodb.org/osx-ssl/mongodb-osx-ssl-x86_64-3.4.9.tgz failed. File 200bytes!?
  • Downloaded via: https://www.mongodb.com/download-center instead
  • Unpacked into downloads, then realised this is much much easier via homebrew, which we have installed. So:
  • brew update (this takes a good 30 seconds)
  • brew install mongodb
  • Created a new folder under projects called mongo/data
  • Checked mongod is in path via which mongod
  • (reports /usr/local/bin/mongod, so homebrew did its thing fine
  • ls ~/Projects/mongo/data to check with have the right path for mongo data (we just created)

boom! 🙁

mongo ~/Projects/mongo/data
MongoDB shell version v3.4.9
connecting to: mongodb:///Users/shellbryson/Projects/mongo/data
2017-10-15T22:13:46.886+0100 E QUERY    [thread1] Error: Failed to parse mongodb:// URL: mongodb:///Users/shellbryson/Projects/mongo/data :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed
  • …failed because I forgot the dbpath param: mongod –dbpath
  • mongo --dbpath ~/Projects/mongo/data
  • Success!

Okay we now have MongoDB installed. Lets add some tools:

  • Registered and downloaded MongoDB Compass with default options. Ran it, and it connected fine.