Problem on "Get Set for our Dynamic Web Application Projects"

i’m on this part of the back end web development certificate, i’m using glitch.com and i need to install mongodb (using ‘apt-get install mongodb-org’) but i can’t, apparently because i need administrator privileges, which glitch.com does not seem to allow. the console throws the following error:
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

i have also tried ‘sudo apt-get install mongodb-org’, which returns:
bash: sudo: command not found

has anyone else experienced this? and if yes, what did you do to resolve this?

thanks in advance :smiley:

Can you show your application code and/or repository? Are you trying to install mongodb only so that your application in glitch references a mongodb Database ? then all you have to do is specify it in your package.json file and glitch will pick it up. If however you need to create the database then you have to either install mongodb locally on your machine or use mlab, which will remotely host a mongodb database for you.

I’m sorry but I actually have nothing in my app yet since i’m still trying to configure stuff. Will using npm install mongodb-org accomplish the same thing? Also, I’m not exactly sure why i’m installing mongodb aside from the instructions, which specified using apt-get install.

No problem , think of it as 2 separate things , creating your database and accessing it. To create your database you have a 2 options, either create it locally, which means downloading mongodb directly onto your machine and configuring it , or , the more simpler option , create your database remotely in a service like mlab that I pointed you to earlier.
Once you create it, then your application needs to reference and or access the database, for this you have to specify mongodb as a dependency in your package.json file, which brings in all the functionality of mongodb right into your application. I suggest starting with a simpler project like Url shortner to familiarize your self with mongodb. Post questions here when you are stuck

1 Like

thanks! will try that.