Is there a manual install of node.js for Windows 7?

荒凉一梦 提交于 2019-12-23 02:36:38

问题


I have easily installed Node.js before on Macs and other PCs, but the PC I have now at work restricts the running of .msi files.

Is there a way to manually install and configure node.js and npm on Windows 7? I have access to Powershell.


回答1:


Installing nodejs (and npm) on a Windows 7 machine does not require any "magic" if you have Admin access on the target machine and do not care about setting up the expected "uninstall", various Windows performance counters, event tracing or Start menu entries.

To manually install from an existing installation on one machine to another machine, simply

  1. Copy the entire contents of your "\Program Files\nodejs" and "\Users\USERNAME\AppData\Roaming\npm" directories as well as the "\Users\USERNAME\.npmrc" file to the same directories on target machine. (Replace USERNAME with your own Windows login name.)

  2. Edit the "\Users\USERNAME\.npmrc" file to replace the source username with the username on the target machine.

  3. Add "C:\Program Files\nodejs" and "C:\Users\USERNAME\AppData\Roaming\npm" to your PATH.

If you'd like to manually install direct from the MSI (without an existing installation to work from), get Scott Willeke's excellent lessmsi program, which allows you to extract all the files from any msi archive and discover all the actions taken by the Windows Installer, such as required edits to the Register, etc. (Though for nodejs, you'll only need to edit the Registry to add the proper keys to uninstall it automagically.)



来源:https://stackoverflow.com/questions/20504309/is-there-a-manual-install-of-node-js-for-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!