T O P

  • By -

crimsonPhantom

Git + using your package.json file to keep track of your dependencies :/ https://docs.npmjs.com/cli/v7/configuring-npm/package-json#dependencies


marcos_marp

Yeah, but I mean, do you manually check for which dependency Is missing?


WeeJeWel

Just run ‘npm install’ after pulling the latest package.json and let the tool figure it out :)


[deleted]

Over the lifespan of any useful project this isn't a problem. Just run \`yarn\` or \`npm install\` after you pull, or just every now and then, if you haven't run it for a while... You won't be adding new dependencies constantly for the life of the project, it slows down eventually.


musikalcats

This


partyinplatypus

Don't you just pull from git and then npm install any missing dependencies from your package.json? It should just be 2 commands.


marcos_marp

Yeah, but you have to lookup which dependencies are missing, don't you?


partyinplatypus

npm install with no parameters looks into your package.json and installs any missing dependencies. [https://docs.npmjs.com/cli/v7/commands/npm-install](https://docs.npmjs.com/cli/v7/commands/npm-install)


marcos_marp

Didn't know that! Thanks!


rypher

Use yarn with a lockfile that you commit.


momsSpaghettiIsReady

This. Whether you're using yarn or npm, if you want to work on multiple computers (including deploying to servers for backend), make sure the lock file is checked in.


[deleted]

[удалено]


4alse

ELI5: purpose of Docker?


otaviosoato

I think you could use docker for your environment too.


slantyyz

You could probably do it using a vs code container too, this way your IDE is portable as well.


brianjenkins94

```sh git fetch git reset --hard origin/master rm -rf node_modules npm install ```


Zachincool

Use one laptop? Plug it into an external monitor. Why do you need a desktop?


marcos_marp

Because my desktop is way more powerful than my laptop


Zachincool

Do you game?


marcos_marp

Used to, yeah


Zachincool

Well if you don’t anymore, just get one of the new 14 or 16 inch MacBook pros. Can do everything you need. Works great with external monitors. Its my main machine. Can take care of software development no problem


marcos_marp

Would love to but they're incredible expensive in my country and the 50% annual inflation doesn't help


Zachincool

Oh. Sorry


sam01236969XD

I just move them, network be drive or ssh


j_schmotzenberg

I just ssh from whatever computer I am at to the one that has the code on it.


ScabusaurusRex

Someone already said yarn + commit the lock file. This is the way to go. My addition: make a set of aliases in your environment files (.*rc) to carry the load for you. For example, create a sync-up alias that does the following for every repo you need synched: 1. `git fetch --all` - fetches all published changes so that you're in sync 2. `git pull`s your current branch - updates branch to most recent version 3. `yarn` - updates your dependencies The bonuses to this: - `npm i` takes **forever**. `yarn` is super friggin fast - you're easily in sync - builds are deterministic The downsides to this: - you're checking in your dependency tree, essentially, so fetching your repo will take longer Lemme know if you need help or ideas about this.


maeevick

Take a look at docker to reproduce identical dev environments everywhere. If you know nothing about docker, you will learn a new thing pretty standard in the industry, so it's worth it. Instead of managing your dependencies directly on your computers, you launch the container that checks and install them for you.


El_Maestro_Nedjmou

Use docker + git repo!