The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1505)
Asked Answered
B

1

6

I just updated my node version today to v16. Now when I try to use forever to run an app forever I get an error that prevents me to open my app, I was looking so hard on google to find a solution but I could find anything. Does anyone have a fix or know how to fix it?

(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'
}
Boeschen answered 11/12, 2021 at 18:12 Comment(4)
It looks like forever has an incompatibility with the latest version of nodejs (probably because something changed in nodejs). I'd suggest you go look in the forever repository/doc at the compatibility notes and issues and see what people are saying about compatibility with v16. FYI, you may also need to make sure you have the latest version of forever.Sudoriferous
Here's a discussion of something similar: #64714065.Sudoriferous
And here's the exact issue in the forever repository: github.com/foreversd/forever/issues/1077. Other than downgrading nodejs, it is not clear to me from that bug report how you fix that.Sudoriferous
im running into the same error message today with a typescript project, but its only in production - were you able to find a solution? #73666656Dowager
S
0

You use forever version < 3.0.0. To use forever with nodejs version >= 14.x.x (including yours v16) you must upgrade forever to v3.0.0 at least. By testing this bug is fixed in v3.0.0 although author does not mention it in changelog: https://github.com/foreversd/forever/blob/master/CHANGELOG.md#300--fri-22-may-2020

Note that using forever on nodejs => 14.x.x you will see warning Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency but forever is working.

Sediment answered 3/10, 2023 at 6:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.