Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_INVALID_ARG_TYPE on macOS 10.15 node v14.1.0 #360

Open
aklkv opened this issue May 5, 2020 · 4 comments
Open

ERR_INVALID_ARG_TYPE on macOS 10.15 node v14.1.0 #360

aklkv opened this issue May 5, 2020 · 4 comments

Comments

@aklkv
Copy link

aklkv commented May 5, 2020

Watching /Users/aklkv/.hotel/servers
create /Users/aklkv/.hotel/daemon.pid 3384
internal/fs/utils.js:658
    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 (3384)
    at Object.writeFileSync (fs.js:1380:5)
    at Object.create (/usr/local/lib/node_modules/hotel/lib/pid-file.js:18:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/hotel/lib/daemon/index.js:20:9)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'ERR_INVALID_ARG_TYPE'
@aklkv aklkv changed the title ERR_INVALID_ARG_TYPE on macOS 10.15 nodev14.1.0 ERR_INVALID_ARG_TYPE on macOS 10.15 node v14.1.0 May 5, 2020
@alanlima
Copy link
Contributor

alanlima commented May 6, 2020

Hi @aklkv
I also have this same issue here and I found out that the validation on fs.writeFileSync changed to not allow numbers to be passed in.

A quick fix is to change the pid-file.js:

function create() {
  console.log('create', pidFile, process.pid)
-  return fs.writeFileSync(pidFile, process.pid)
+  return fs.writeFileSync(pidFile, process.pid.toString())
}

I created the PR #361 to fix it.

@aklkv
Copy link
Author

aklkv commented May 6, 2020

@alanlima Thank you so much for solution! I can confirm it fixes the issue for me!

@alexrjs
Copy link

alexrjs commented Jun 9, 2020

Guess, there is only the way to patch this file locally, since no release since 2018. Thanks for the fix.

@zachwill
Copy link

zachwill commented Sep 8, 2020

Hey @alanlima @typicode,

This is 100% the solution to get hotel working on Mac OS 10.15 with node v14.9.0

Any chance we could get #361 merged? (As @alexrjs suggests, the only other way is to patch pid-file.js locally.)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants