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

TypeError: The "code" argument must be of type number. Received an instance of Object #598

Closed
gmcamposano opened this issue Nov 15, 2023 · 9 comments

Comments

@gmcamposano
Copy link

I am getting this error with npx contentlayer build

Generated 2 documents in .contentlayer
TypeError: The "code" argument must be of type number. Received an instance of Object
    at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
    at Cli.runExit (/home/gabriel/Desktop/markdown-app/node_modules/clipanion/lib/advanced/Cli.js:232:26)
    at run (file:///home/gabriel/Desktop/markdown-app/node_modules/@contentlayer/cli/src/index.ts:39:3)
    at main (/home/gabriel/Desktop/markdown-app/node_modules/contentlayer/bin/cli.cjs:5:3) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Anyone else?

@jrolfs
Copy link

jrolfs commented Nov 15, 2023

Yeah, see #495. It's related to Cli#runExit and this:

This is related to Node Deprecation DEP0164 (process.exit(code), process.exitCode coercion to integer.

It seems the build command is yielding an object instead of an exit code number. I'm going to open a PR for this and I'll also add a workaround to the comments in #495.

@gmcamposano
Copy link
Author

Yeah, see #495. It's related to Cli#runExit and this:

This is related to Node Deprecation DEP0164 (process.exit(code), process.exitCode coercion to integer.

It seems the build command is yielding an object instead of an exit code number. I'm going to open a PR for this and I'll also add a workaround to the comments in #495.

Thank you for your quick reply. So its basically related to Node. Meanwhile, i am able to build normally on Node 20.9.0 but with the error shown above.

@dogcity
Copy link

dogcity commented Nov 24, 2023

Hi, I also have the same error, but the compilation goes fine.

@Taimoorkhan1122
Copy link

Hi, having same issue

The "code" argument must be of type number. Received an instance of Object

@FelipeFTN
Copy link

I Just executed using Sudo (Administrator permissions) and it just worked! 🚀

Copy link

stale bot commented Mar 10, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale label Mar 10, 2024
@stale stale bot closed this as completed Mar 22, 2024
@kachkaev
Copy link

oh no, not stale 😞

@vincent-thomas
Copy link

i have this issue too

@igormcsouza
Copy link

Yeah, see #495. It's related to Cli#runExit and this:

This is related to Node Deprecation DEP0164 (process.exit(code), process.exitCode coercion to integer.

It seems the build command is yielding an object instead of an exit code number. I'm going to open a PR for this and I'll also add a workaround to the comments in #495.

Downgrade to node v18.20 worked for me! Issue is gone.. I'll be still tracking that to get the fix for Node v20!

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

No branches or pull requests

8 participants