Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

使用国内镜像加速安装

CodeColorist edited this page Mar 14, 2018 · 3 revisions

国内网络可能会遇到软件源访问困难,导致无法完成安装的问题。

对于 npm,可使用淘宝的镜像服务和命令行工具 cnpm:https://npm.taobao.org/

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install -g passionfruit

即使使用了 cnpm,由于部分预编译包需要从 GitHub 或者 AWS 下载,也可能遇到网络障碍。

请观察安装日志中类似如下的内容:

prebuild-install info begin Prebuild-install version 2.5.1
prebuild-install info looking for local prebuild @ prebuilds/frida-v10.7.1-node-v59-darwin-x64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/username/.npm/.cache/cnpm/_prebuilds/https-github.com-frida-frida-releases-download-10.7.1-frida-v10.7.1-node-v59-darwin-x64.tar.gz
prebuild-install http request GET https://github.com/frida/frida/releases/download/10.7.1/frida-v10.7.1-node-v59-darwin-x64.tar.gz
prebuild-install http 200 https://github.com/frida/frida/releases/download/10.7.1/frida-v10.7.1-node-v59-darwin-x64.tar.gz

日志表示将现在本地查找缓存的预编译包(prebuilt),失败则从 GitHub 的 release 下载一个。如果命令行下载失败,请记录下这个地址和本地的路径,使用可靠的代理工具下载源文件到缓存路径。

重新执行 cnpm install -g passionfruit,问题解决:

$ cnpm install -g passionfruit
npm WARN deprecated babel-preset-es2015@6.24.1: ????  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
/usr/local/bin/passionfruit -> /usr/local/lib/node_modules/passionfruit/bin/cli.js
+ passionfruit@0.2.1
updated 1 package in 18.823s
Clone this wiki locally