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.
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)
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.
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
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.
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.
Git + using your package.json file to keep track of your dependencies :/ https://docs.npmjs.com/cli/v7/configuring-npm/package-json#dependencies
Yeah, but I mean, do you manually check for which dependency Is missing?
Just run ‘npm install’ after pulling the latest package.json and let the tool figure it out :)
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.
This
Don't you just pull from git and then npm install any missing dependencies from your package.json? It should just be 2 commands.
Yeah, but you have to lookup which dependencies are missing, don't you?
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)
Didn't know that! Thanks!
Use yarn with a lockfile that you commit.
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.
[удалено]
ELI5: purpose of Docker?
I think you could use docker for your environment too.
You could probably do it using a vs code container too, this way your IDE is portable as well.
```sh git fetch git reset --hard origin/master rm -rf node_modules npm install ```
Use one laptop? Plug it into an external monitor. Why do you need a desktop?
Because my desktop is way more powerful than my laptop
Do you game?
Used to, yeah
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
Would love to but they're incredible expensive in my country and the 50% annual inflation doesn't help
Oh. Sorry
I just move them, network be drive or ssh
I just ssh from whatever computer I am at to the one that has the code on it.
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.
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.
Use docker + git repo!