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

listr2 unexpected token '??=' #1313

Closed
Marckon opened this issue Aug 14, 2023 · 5 comments
Closed

listr2 unexpected token '??=' #1313

Marckon opened this issue Aug 14, 2023 · 5 comments

Comments

@Marckon
Copy link

Marckon commented Aug 14, 2023

Description

after update from v13.2.3 to v13.3.0, when run in husky pre-commit hook I get this error:

file:///xxxx/node_modules/_listr2@6.6.1@listr2/dist/index.js:206
    this.options.fields ??= {};
                        ^^^

SyntaxError: Unexpected token '??='
    at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18)
husky - pre-commit hook exited with code 1 (error)

Steps to reproduce

Debug Logs

expand to view
COPY THE DEBUG LOGS HERE

Environment

node v18.4.0
package.json

"lint-staged": {
    "*.{js,jsx,ts,tsx}": "eslint"
  },
  • OS:
  • Node.js:
  • lint-staged:
@iiroj
Copy link
Member

iiroj commented Aug 14, 2023

13.3.0 was an incorrect release and is functionally the same as 14.0.0. Please upgrade to that.

@iiroj
Copy link
Member

iiroj commented Aug 14, 2023

See #1312 for more info.

@iiroj iiroj closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
@iiroj
Copy link
Member

iiroj commented Aug 14, 2023

That said, the nullish coalescing assignment should be available since Node.js 15... are you using 14 by accident?

@Marckon
Copy link
Author

Marckon commented Aug 15, 2023

Thanks! Indeed, I accidentally used v14 node. I configured install-node in my package.json file, although node -v outputs the v18.4.0 version

  "engines": {
    "install-node": "v14.17.5"
  },

@iiroj
Copy link
Member

iiroj commented Aug 16, 2023

Relevant PR is #1289

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

2 participants