Skip to content

"TypeError: common.register is not a function" under node v20.6.0 #1133

@bkuri

Description

@bkuri

Node version (or tell us if you're using electron or some other framework): v20.6.0

ShellJS version (the most recent version/Github branch you see the bug on): v0.8.5

Operating system:

Linux bkuri-desktop 6.5.1-AMD-znver2 #1 SMP PREEMPT_DYNAMIC Sat Sep 2 07:47:03 UTC 2023 x86_64 GNU/Linux

Description of the bug:

Running my cli app under node v20.6.0 gives me the following output:

/home/.../node_modules/shelljs/src/cat.js:4
common.register('cat', _cat, {
       ^

TypeError: common.register is not a function
    at Object.<anonymous> (/home/.../node_modules/shelljs/src/cat.js:4:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at /home/.../node_modules/shelljs/shell.js:25:3
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/.../node_modules/shelljs/shell.js:24:23)

Node.js v20.6.0
error Command failed with exit code 1.

The error goes away after downgrading to node v20.5.1.

Example Shell command to reproduce the error:

$ nvm use 20.6
$ yarn start # TypeError...
$ nvm use 20.5.1
$ yarn start

Hope it's not too vague of a report… Let me know if you need more details 👍

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions