SyntaxError: Invalid regular expression on running `hlx import`
silky1708 opened this issue · comments
Hi,
I'm getting the following error on running hlx import
inside the project directory. I've successfully installed helix cli using: npm install -g @adobe/helix-cli
.
path/to/lib/node_modules/@adobe/helix-cli/node_modules/camelcase/index.js:1
const UPPERCASE = /[\p{Lu}]/u;
^^^^^^^^^^^
SyntaxError: Invalid regular expression: /[\p{Lu}]/: Invalid property name in character class
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
Node.js v18.16.0
I'm getting the same error on running hlx --help
.
Thanks.
hi @silky1708 thanks for reporting. that is weird...
can you run
$ node -e 'console.log(/[\p{Lu}]/u.test("FooBar"));'
maybe related to:
what OS are you running this ?
Hi @tripodsan, this is the output I get on running node -e 'console.log(/[\p{Lu}]/u.test("FooBar"));'
:
[eval]:1
console.log(/[\p{Lu}]/u.test("FooBar"));
^^^^^^^^^^^
SyntaxError: Invalid regular expression: /[\p{Lu}]/: Invalid property name in character class
at new Script (node:vm:100:7)
at createScript (node:vm:259:10)
at Object.runInThisContext (node:vm:307:10)
at node:internal/process/execution:79:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:78:60)
at node:internal/main/eval_string:28:3
Node.js v18.16.0
I am running this locally on MacOS.
that is weird, I have the same setup and get something different. did you install a specific variant of nodejs? or just normally using nvm
?
my output:
$ node -e 'console.log(/[\p{Lu}]/u.test("FooBar"));'
true
$ node --version
v18.16.0
Hi @tripodsan,
I re-installed node.js
using brew: brew installe node
, and it works fine now. Thanks!
$ node -e 'console.log(/[\p{Lu}]/u.test("FooBar"));'
true
$ node --version
v20.3.1
I am closing the issue as resolved.
thanks @silky1708 .just in case you want/need to manage several node versions, using https://github.com/nvm-sh/nvm is very helpful.
just out of curiosity: do you have a special (non latin) OS / console language ?
locale
on terminal gives me the following output:
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=