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

后端 未结 3 1014
梦谈多话
梦谈多话 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:25

    I'm not sure what you are talking about, the node installer has this page. Node Installer

    What version of node are you trying to install? This screenshot is taken from v0.11.7 of node.

    0 讨论(0)
  • 2021-01-12 16:28

    I know this post was basically forever ago, but I found a much easier way than manipulating the path. Simply uninstall NPM using the npm uninstaller, reinstall on your other drive with a new folder called nodejs. It'll create the folder in there appropriately and npm will be successfully installed on you D drive.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题