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

Required Node [email protected] throws a TypeError on MacOS 15.1 when running from source (with a sloppy fix) #176

Open
cacology opened this issue Oct 29, 2024 · 0 comments

Comments

@cacology
Copy link

Following the steps from the section "Running from source" calling npm start aborts with an error:

> [email protected] start
> node src/server.js

/Users/user/projects/translation-server/node_modules/config/lib/config.js:1217
    } else if (Utils.isRegExp(parent)) {
                     ^

TypeError: Utils.isRegExp is not a function
    at _clone (/Users/user/projects/translation-server/node_modules/config/lib/config.js:1217:22)
    at Config.cloneDeep (/Users/user/projects/translation-server/node_modules/config/lib/config.js:1255:10)
    at /Users/user/projects/translation-server/node_modules/config/lib/config.js:1515:32
    at Array.forEach (<anonymous>)
    at util.extendDeep (/Users/user/projects/translation-server/node_modules/config/lib/config.js:1492:9)
    at /Users/user/projects/translation-server/node_modules/config/lib/config.js:727:14
    at Array.forEach (<anonymous>)
    at /Users/user/projects/translation-server/node_modules/config/lib/config.js:721:14
    at Array.forEach (<anonymous>)
    at util.loadFileConfigs (/Users/user/projects/translation-server/node_modules/config/lib/config.js:720:13)

If I manually edit the offending node_modules/config/lib/config.js thus:

From

    if (Utils.isArray(parent)) {
      child = [];
    } else if (Utils.isRegExp(parent)) {
      child = new RegExp(parent.source, util.getRegExpFlags(parent));
      if (parent.lastIndex) child.lastIndex = parent.lastIndex;
    } else if (Utils.isDate(parent)) {

To

    if (Utils.types.isArray(parent)) {
[...]
    } else if (Utils.types.isDate(parent)) {

Everything seems to work fine. I think this is probably a bug in config or something, but I'm not very knowledgeable about how to work with npm packages. Could updating the version of config required fix the problem?

uname -v: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031

npm -v: 10.9.0

node -v v23.1.0

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

No branches or pull requests

1 participant