创建http://nodejs.org/dist的私有镜像

Create Private Mirror of http://nodejs.org/dist

我想创建 nodejs.org 的代理或本地镜像以提高速度并支持构建可重复性。

如果您有任何建议,请告诉我

support build repeatability.

啊,我想你想镜像支持你的 npm install 构建所需的文件。 npm 和 nodejs.org 没有那种关系。 npm 不仅仅是一个普通的平面文件网站,您可以使用 wget 进行镜像。这是一个复杂的网络应用程序。我建议只使用现有服务,但如果您想继续这样做,您需要查看 npm Enterprise

由于robots.txt 规则,

wget 不能镜像它。您可以使用 -e robots=off.

忽略它们

If you know what you are doing and really really wish to turn off the robot exclusion, set the robots variable to ‘off’ in your .wgetrc. You can achieve the same effect from the command line using the -e switch, e.g. ‘wget -e robots=off url...’.

来自 Wget Manual

如果你也想安装 npm(可能用于专用网络)你可以使用我写的一个小脚本:gist