0

I'm a complete newbie trying to break into the world of all the wonderful new technologies coming forward, and it seems part of that meant installing Node, as it's something a lot of programmers are using. I installed it on my D: drive, great! Issue: When I use npx install, it wants to send what I'm installing to the C: drive, which has like 6 GB of space left.

Is there a way I can tell Node where to send things when I use npx to install things?

I tried installing Node to D: drive, used npx to install something, and Node tried to put it on my C: drive automatically. Also tried changing the directory in nodejs\node_modules\npm\npmrc.

  • this could give some [insight](https://stackoverflow.com/questions/5926672/where-does-npm-install-packages) – Bharath May 05 '23 at 11:58
  • Have you tried adding an [npmrc](https://docs.npmjs.com/cli/v8/configuring-npm/npmrc) file to your root folder, and giving it a `prefix` attribute to specify where willl your packages get installed ? – l -_- l May 05 '23 at 12:00
  • There was one in nodejs\node_modules\npm that I modified as such, now that you mention it, but that didn't work out. Would npx function on a different directory, perhaps...? Where precisely would I put this npmrc file? – Lost In THE NUMBERS MASON May 05 '23 at 12:59
  • Does this answer your question? [Install Node.js on a different hard drive from C to D](https://stackoverflow.com/questions/18965126/install-node-js-on-a-different-hard-drive-from-c-to-d) – Hamada May 05 '23 at 13:10
  • @Hamada It doesn't seem to, because my Node.exe is already on D: and it's still putting the installed packages on C:, however I did recently come upon a thing buried in discussions for the actual package I'm trying to install that might fix my problem. I'll try fixing with that and update if it works out. – Lost In THE NUMBERS MASON May 05 '23 at 17:18

0 Answers0