AdGuardHome+Passwall配合使用配置

我个人平时在用 OpenWrt 软路由时,是 Passwall 和 AdGuardHome 搭配使用的。这两个组合非常轻量,因为 AdGuardHome 具有缓存功能,所以速度非常快,而且还可以一定程度上过滤广告,实测家里的小米电视开屏广告也没了。同时,通过 Passwall 的 DNS 分流功能,可以做到国内毫秒级响应,访问国外网站也不会受到 DNS 污染的影响。下面介绍一下我是如何配置的

阅读更多

nrm报错

报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
internal/validators.js:112
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^

[TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at validateString (internal/validators.js:112:11)
at Object.join (path.js:375:7)
at Object.<anonymous> (C:\Users\wy\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11
] {
code: 'ERR_INVALID_ARG_TYPE'
}

解决

找到nrm安装位置,打开cli.js修改第17行

windows下目录在C:\Users\用户名\AppData\Roaming\npm\node_modules\nrm\

1
2
//const NRMRC = path.join(process.env.HOME, '.nrmrc'); (删除)
const NRMRC = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.nrmrc');

Windows下RSSHub执行NPM i报错.md

背景

今天fork了一份RSSHub准备玩一下,发现 npm i的时候一直报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/BYVoid/OpenCC/releases/download/1.1.1/opencc-v1.1.1-node-v72-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.1321) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - missing any Windows SDK
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8

原因

在Windows下安装到一些库时,需要编译,所以要按相关环境

解决

  • 管理员打开 CMD
  • 运行 npm install --g --production windows-build-tools
    1
    2
    3
    4
    5
    6
    7
    8
    ---------- Visual Studio Build Tools ----------
    Successfully installed Visual Studio Build Tools.
    ------------------- Python --------------------
    Successfully installed Python 2.7

    Now configuring the Visual Studio Build Tools and Python...

    All done!
    成功

再次执行npm i就成功了

参考