Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Node.js on a different hard drive from C to D

I have node and npm with existing packages currently installed to the C drive on Windows. My C drive is an SSD with a low amount of space. How can I move the node installation to a different drive? Would I need to reinstall node and all packages? The current node installer doesn't seem to specify drives.

like image 336
CMCDragonkai Avatar asked Sep 23 '13 17:09

CMCDragonkai


1 Answers

You can move the node.exe to the d drive. Then check your environment path. Type set in a command window or in computer properties. Make sure you have the folder that contains node.exe in your path. Running node in a command window will work from any folder then.

For installed npm packages, ie.. node_modules folder.. That just needs to be in a directory above where your writing your code, so try putting that folder in d:\ Assuming your going to be writing your apps on the d drive now.

In .npmrc file, change prefix setting to desired folder. Global packages get installed in node_modules under that folder

like image 146
John Williams Avatar answered Sep 18 '22 12:09

John Williams