Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Building a MEAN Application Introduction to the MEAN Stack Setting Up an Express Application

David Hughes
David Hughes
5,063 Points

Shouldn't we clone the forked repo into the "mean-todo" folder since the repo already has public and src folders?

We are instructed to setup directories like so:

Root(Public in this case) -> mean-todo -> public

And then initialize git the public directory. When I try to use the clone command inside of public, with the "." to unpack it says:

fatal: destination path '.' already exists and is not an empty directory."

If we just clone the repo into the 'mean-todo' folder wouldn't it just unpack the public and src folders in the repo for us so we don't need to create them ourselves?

--edited or clarification.

3 Answers

Seth Kroger
Seth Kroger
56,403 Points

The repo in question, https://github.com/treehouse/angular-basics, doesn't have those directories setup. It's just the client side of the app, and that needs to go into public. There was another repo with the whole MEAN app as you described, but that isn't what we're being asked to clone.

I think the issue is you ran git init before git clone. The clone command automatically initializes the repo for you so their use is either/or not both/and. If you're sure you're in the public directory and it's otherwise empty you could try removing the .git/ directory and redo the clone command or manually add the GitHub repo with git remote add ... then git pull origin master

David Hughes
David Hughes
5,063 Points

I forked this: https://github.com/treehouse-projects/mean-todo

I think you are right! I deleted the .git folder and did clone before git init, and it did clone the files properly. I'm having other issues now but could you verify that the directory tree should look like:

Projects -> mean-todo -> public -> (cloned repo contents)

Irene De Nicolo
Irene De Nicolo
1,737 Points

just run

git clone https://github.com/treehouse/angular-basics .

and you should be good to go. The complete project and the angular-basics are two different things ;)

That worked for me. Thanks! MEAN on

Seth Kroger
Seth Kroger
56,403 Points

Your project should look like this after cloning:

mean-todo/
   |
   \---public/
         |-index.html
         |-scripts/
         |-etc.
David Hughes
David Hughes
5,063 Points

So do I clone from the mean-todo directory? Sorry! I'm so confused...

When I follow the video instructions I make "public" and "src" directories inside of mean-todo. Then I go into public and clone the repo, creating another public folder inside of public, is this correct?

Thanks for your time.

Seth Kroger
Seth Kroger
56,403 Points

No, you're supposed to be cloning the repo from the previous Angular Basics course, not the repo with the completed project from this course.

David Hughes
David Hughes
5,063 Points

Jeez, no wonder. OK!

Let me redo this and see if I can get it to work then. Thanks for the assistance!

Duncan Gossage
Duncan Gossage
3,196 Points

Yeah the problem I found which made me spend about 3 hours trying to get to the bottom of was that we were told to create a root folder with public and src folders, then go into the the public folder and git clone into there...

Then return to the root, go into the src and add the app.js with the Express code in...

This is what has caused all of the public/public/ issues that I'm seeing from other people. I have the following from this video

  mean-todo/
  |
  \---public/
              |
              \---app/
              \---mock/
              \---public/
              \---src/
              |- .gitignore
              |- .package.json
              |- .README.md
              |- .webpack.config.js
  \---src/
  |- .gitignore
  |- package.json

So i had to add

  app.use('/', express.static('public/public/'));

I also found nothing was working still and had to run in /public

  npm install
  webpack

This wasn't told to me, I just went with the flow and thought things would work....

Still I mustn't grumble, I feel I've learn a lot during the last 3 hours about folder structures :-P