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

使用国内镜像加速安装

CodeColorist edited this page Feb 13, 2020 · 3 revisions

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

使用 cnpm

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

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

预编译包失败

请确保使用 Node.js 的 LTS (Long Term Support) 版本。高于 LTS 的版本可能遇到 frida 没有提供预编译包的情况,需要自行从源码编译。

即使使用了 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 [email protected]: ????  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
+ [email protected]
updated 1 package in 18.823s

注:cnpm 存在一个 bug,如果上一次 cnpm install 被中断,第二次安装将会误认为安装成功而跳过应有的项目,导致实际上没有安装。解决方案是删除 node_modules 后重新安装。

Clone this wiki locally