是否有针对 Windows 7 的 node.js 手动安装? [英] Is there a manual install of node.js for Windows 7?

查看:73
本文介绍了是否有针对 Windows 7 的 node.js 手动安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前在 Mac 和其他 PC 上轻松安装了 Node.js,但我现在工作的 PC 限制了 .msi 文件的运行.

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.

有没有办法在 Windows 7 上手动安装和配置 node.js 和 npm?我可以访问 Powershell.

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

推荐答案

在 Windows 7 机器上安装 nodejs(和 npm)不需要任何魔法",如果你在目标机器上有管理员权限并且不关心设置增加预期的卸载"、各种 Windows 性能计数器、事件跟踪或开始菜单项.

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. 将\Program Files\nodejs"和\Users\USERNAME\AppData\Roaming\npm"目录的全部内容以及\Users\USERNAME\.npmrc"文件复制到相同的目标机器上的目录.(将 USERNAME 替换为您自己的 Windows 登录名.)

  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.)

编辑\Users\USERNAME\.npmrc"文件,用目标机器上的用户名替换源用户名.

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

将C:\Program Files\nodejs"和C:\Users\USERNAME\AppData\Roaming\npm"添加到您的路径中.

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

如果您想直接从 MSI 手动安装(没有可用的现有安装),请获取 Scott Willeke 出色的 lessmsi 程序,它允许您从任何 msi 存档中提取所有文件并发现 Windows 安装程序执行的所有操作,例如对注册器的必需编辑等(尽管对于 nodejs,您只会需要编辑注册表以添加正确的键以自动卸载它.)

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.)

这篇关于是否有针对 Windows 7 的 node.js 手动安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆