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

后端 未结 3 1047
梦谈多话
梦谈多话 2021-01-12 15:44

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 installati

3条回答
  •  梦谈多话
    2021-01-12 16:39

    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

提交回复
热议问题