gemini-cli/node_modules/string-width/index.js:16 "Invalid regular expression flags" after a fresh install
What happened?
Invocation errors immediately after installation on Debian 12.12
uname -a
Linux mogo-p920 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux
There were a bunch of warnings during installation:
npm install -g @google/gemini-cli
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@google/[email protected]',
npm WARN EBADENGINE required: { node: '>=20' },
npm WARN EBADENGINE current: { node: 'v18.20.4', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@google/[email protected]',
npm WARN EBADENGINE required: { node: '>=20' },
npm WARN EBADENGINE current: { node: 'v18.20.4', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@google/[email protected]',
npm WARN EBADENGINE required: { node: '>=20.0.0' },
npm WARN EBADENGINE current: { node: 'v18.20.4', npm: '9.2.0' }
npm WARN EBADENGINE }
...
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@isaacs/[email protected]',
npm WARN EBADENGINE required: { node: '20 || >=22' },
npm WARN EBADENGINE current: { node: 'v18.20.4', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '20 || >=22' },
npm WARN EBADENGINE current: { node: 'v18.20.4', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: Use your platform's native DOMException instead
Error:
a2 ~$ gemini
file:///usr/local/lib/node_modules/@google/gemini-cli/node_modules/string-width/index.js:16
const zeroWidthClusterRegex = /^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v;
^
SyntaxError: Invalid regular expression flags
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:152:18)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:299:14)
Node.js v18.20.4
What did you expect to happen?
Authentication steps
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
# paste output here
Login information
No response
Anything else we need to know?
No response
Found possible duplicate issues:
- #14173
- #13427
- #3872
If you believe this is not a duplicate, please remove the status/possible-duplicate label.
Can you try updating to node version 20? Looks like you're on 18
Can you try updating to node version 20? Looks like you're on 18
@skeshive Worked with node v25.2.1
Should we add a verification for the node version at the beginning of the application execution? v18 was the default debian 12 version and getting a newer version required extra steps that are not obvious for someone who's not into nodejs stuff.
Hmmm IMO the NPM warning should be sufficient. If you feel strongly about the warning, feel free to open a PR for it and add me as a reviewer.
This issue is still exists on v0.20.0 Fresh Install, Why closed? Please Reopen issue
I am on Ubuntu 24. Bumped up node version to 20 using instructions here : https://joshtronic.com/2023/04/23/how-to-install-nodejs-20-on-ubuntu-2004-lts
I no longer see this issue.
Upgrading Notejs version solved. but the error is cofusing. please provide a correct alert