“data”参数必须是字符串类型或者 Buffer、TypedArray 或 DataView 的实例。收到型号(1505)

问题描述 投票:0回答:1

我今天刚刚将我的节点版本更新到 v16。现在,当我尝试使用永远来永远运行应用程序时,我收到一个错误,阻止我打开我的应用程序,我在谷歌上努力寻找解决方案,但我可以找到任何东西。有谁有解决办法或知道如何解决吗?

(node:1498) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/fs/utils:879
  throw new ERR_INVALID_ARG_TYPE(
  ^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1505)
    at Object.writeFileSync (node:fs:2146:5)
    at writePid (/usr/lib/node_modules/forever/bin/monitor:13:6)
    at exports.Monitor.<anonymous> (/usr/lib/node_modules/forever/bin/monitor:46:5)
    at exports.Monitor.EventEmitter.emit (/usr/lib/node_modules/forever/node_modules/eventemitter2/lib/eventemitter2.js:339:22)
    at /usr/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:180:10
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 'ERR_INVALID_ARG_TYPE'
}
node.js forever
1个回答
0
投票

您使用永久版本< 3.0.0. To use forever with nodejs version >= 14.x.x(包括您的v16),您必须至少永久升级到v3.0.0。通过测试,这个错误已在 v3.0.0 中修复,尽管作者没有在变更日志中提及:https://github.com/foreversd/forever/blob/master/CHANGELOG.md#300--fri-22-may-2020

请注意,在nodejs => 14.x.x上使用forever,你会看到警告

Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
,但forever正在工作。

© www.soinside.com 2019 - 2024. All rights reserved.