Skip to content

Commit

Permalink
fix: toString PID number for writeFileSync (second arg requires s…
Browse files Browse the repository at this point in the history
…tring) (#573)

Node 14 will no longer coerce incorrect types given to `writeFileSync`.

The error thrown:

```
TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number
```
  • Loading branch information
Robdel12 authored Oct 14, 2020
1 parent d3b8c43 commit 7207af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/process-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export default class ProcessService {
}

private writePidFile(pid: number) {
fs.writeFileSync(ProcessService.PID_PATH, pid)
fs.writeFileSync(ProcessService.PID_PATH, pid.toString())
}
}

0 comments on commit 7207af1

Please sign in to comment.