Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Rez Ghali
Rez Ghali
10,527 Points

Do I have to install express n pug each time i run the download projects? or is it a better way?

When I download the files in the Basic Express Section on my machine and want to run the app.js in my local machine I need to install Express and Pug and any dependencies first. I wonder is there any way if you can get someone's project and run it on your machine without installing Express each time you work with a new project that you receive from another person?

1 Answer

Not really.

You can install commonly used modules globally, which means you won´t need to install them for each project every time. But it´s not advisable to do so, because each project may have different dependencies, and it will not work properly if a dependency is missing, so the first thing you do when you run a project is npm install everything.

You could containerize your app with docker, or run it on a cloud service like heroku, if that helps.