Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

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

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

Problem

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.

Problem courtesy of: CMCDragonkai

Solution

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

Solution courtesy of: John Williams

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

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

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×