0

I need to run multiple nodeJS applications on my main development machine, which is running a macOS, and a second one, which is a windows system without an internet connection. Because of the missing internet connection, I cannot run npm install.

I want to do some work on the windows system, take the projects back home, do also some work on those projects, and push everything to the repository.

So I decided to put all projects on an external SSD drive and I choose pnpm (https://pnpm.js.org/en/) to save disc space as most projects are using nearly the same dependencies. For me, it doesn't make sense to install the same dependencies 30 times, which would blow up my 250GB drive.

pnpm saves all needed dependencies in a store. The directory should be saved on the SSD drive. But this is the problem.

npm config set store-dir /path/to/.pnpm-store

On my Mac, the path would be /Volumes/SsdName/.pnpm-store and running pnpm install will save all dependencies in the store on my SSD drive. But on the windows machine, the path is E:\. That's why I can't start the projects from the external drive on the windows machine.

Hamada
  • 1,836
  • 3
  • 13
  • 27
user3142695
  • 15,844
  • 47
  • 176
  • 332
  • why don't you use [docker](https://www.docker.com/)? – Ahmed Magdy Jun 30 '20 at 19:20
  • @AhmedMagdy Could you explain it a bit more. I don't see how to use it in this case. My problem is, that the windows machine is heavily restricted for me. So how would your idea with docker work? – user3142695 Jun 30 '20 at 19:25
  • build a docker container for each app, and everytime you need to run one of them just spin it up, if you don't need it then terminate it or stop it that will save you ton of memory. – Ahmed Magdy Jun 30 '20 at 19:31
  • there are multiple tutorials on how to build a docker image. – Ahmed Magdy Jun 30 '20 at 19:31
  • another solution is to install the common packages globally but Idk if running npm install with re-download everything again or no. – Ahmed Magdy Jun 30 '20 at 19:34
  • @AhmedMagdy I know how to build docker images, but I don't understand your concept. I'm editing any files of my app and the dev app is rerendering everytime, so I can check everything at `localhost:3000`. If I'm building a docker image of my app and run it, I can't do any editing of the files to see the changes... – user3142695 Jun 30 '20 at 20:19
  • I thought you just needed to run the apps.. well try the global package installation, there must be some way to reuse node_modules or some part of it. – Ahmed Magdy Jun 30 '20 at 20:48

0 Answers0