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

SyntaxError: Invalid regular expression on running hlx import #2206

Closed
silky1708 opened this issue Jun 28, 2023 · 6 comments
Closed

SyntaxError: Invalid regular expression on running hlx import #2206

silky1708 opened this issue Jun 28, 2023 · 6 comments

Comments

@silky1708
Copy link

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.

@tripodsan
Copy link
Contributor

tripodsan commented Jun 28, 2023

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 ?

@tripodsan tripodsan transferred this issue from adobe/helix-importer-ui Jun 28, 2023
@silky1708
Copy link
Author

silky1708 commented Jun 28, 2023

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.

@tripodsan
Copy link
Contributor

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

@silky1708
Copy link
Author

silky1708 commented Jun 29, 2023

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.

@tripodsan
Copy link
Contributor

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 ?

@silky1708
Copy link
Author

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=

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