youzan/zan-proxy

MacOS Big Sur启动zan-proxy报错

Redzli opened this issue · 3 comments

见以下,安装了 zan-proxy,但是无法启动

❯     zan-proxy --version

4.0.27
❯     zan-proxy

(node:49680) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1627543775468)
    at Object.writeFileSync (fs.js:1517:5)
    at Object.set (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:46:22)
    at Object.<anonymous> (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:56:19)
    at Generator.next (<anonymous>)
    at /Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:3:12)
    at Object.exports.default (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:50:25)
    at /Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/index.js:35:39
    at Generator.next (<anonymous>)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:49680) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:49680) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

见以下,安装了 zan-proxy,但是无法启动

❯     zan-proxy --version

4.0.27
❯     zan-proxy

(node:49680) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1627543775468)
    at Object.writeFileSync (fs.js:1517:5)
    at Object.set (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:46:22)
    at Object.<anonymous> (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:56:19)
    at Generator.next (<anonymous>)
    at /Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:3:12)
    at Object.exports.default (/Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/selfUpdate.js:50:25)
    at /Users/bytedance/.config/yarn/global/node_modules/zan-proxy/dist/bin/index.js:35:39
    at Generator.next (<anonymous>)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:49680) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:49680) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

同问,
系统:MacOS 10.15.0
node: v14.15.0
npm: 6.14.8

步骤:

  1. npm i -g zan-proxy
  2. zan-proxy --version => 4.0.27
  3. zan-proxy // 报错等同于上面的同学

系统:MacOS 11.6
node: v16.10.0
npm: 7.24.0
我也是一样报错,卸载重装Node了,故障还是这样,折腾了一个小时了唉

`node:internal/errors:464
ErrorCaptureStackTrace(err);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1633265976271)
at Object.writeFileSync (node:fs:2146:5)
at Object.set (/usr/local/lib/node_modules/zan-proxy/dist/bin/selfUpdate.js:46:22)
at Object. (/usr/local/lib/node_modules/zan-proxy/dist/bin/selfUpdate.js:56:19)
at Generator.next ()
at /usr/local/lib/node_modules/zan-proxy/dist/bin/selfUpdate.js:7:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/zan-proxy/dist/bin/selfUpdate.js:3:12)
at Object.exports.default (/usr/local/lib/node_modules/zan-proxy/dist/bin/selfUpdate.js:50:25)
at /usr/local/lib/node_modules/zan-proxy/dist/bin/index.js:35:39
at Generator.next () {
code: 'ERR_INVALID_ARG_TYPE'
}`

启动时 命令使用 zan-proxy --no-update 可以启动成功 参考 #61