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: optionDefinitions.flatMap is not a function #41

Closed
pietro-coretto opened this issue Aug 3, 2021 · 3 comments
Closed

TypeError: optionDefinitions.flatMap is not a function #41

pietro-coretto opened this issue Aug 3, 2021 · 3 comments

Comments

@pietro-coretto
Copy link

pietro-coretto commented Aug 3, 2021

I installed via npm and I get this

$ bibtex-tidy  myrefs.bib
/usr/local/lib/node_modules/bibtex-tidy/bin/bibtex-tidy:5342
var OPTIONS = new Set(optionDefinitions.flatMap((def) => Object.keys(def.cli)));
                                        ^
TypeError: optionDefinitions.flatMap is not a function
    at Object.<anonymous> (/usr/local/lib/node_modules/bibtex-tidy/bin/bibtex-tidy:5342:41)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

I suppose it may be an issue with my java settings, any hint?

@FlamingTempura
Copy link
Owner

Could you check your node version?

node -v

Currently bibtex-tidy requires at least v11.15.

Could you also let me know your OS and how you installed node?

@pietro-coretto
Copy link
Author

pietro-coretto commented Aug 4, 2021

I am on Linux Elementary OS 5.1 and it seems that apt manager keeps node back to 8.x

~$ node -v
v8.10.0

I tried to install it via snap but it didn't work. After some trial, I completely removed node with

apt-get purge node

and then I installed the latest stable version 16.x from the official repo (instructions for debian/ubuntu distros) doing

curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs

The complete documentation is here

https://github.com/nodesource/distributions#debinstall

Therefore this solved the issue

Thanks

@FlamingTempura
Copy link
Owner

Thanks for reporting back. Glad you got it working.

I'll leave this issue open because bibtex-tidy should give a better error if it's an unsupported node version.

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

2 participants