conventional-changelog / commitlint

📓 Lint commit messages
https://commitlint.js.org
MIT License
16.65k stars 892 forks source link

SyntaxError: Unexpected reserved word #2256

Closed geeksilva97 closed 3 years ago

geeksilva97 commented 3 years ago

I am trying to add commitlint to an Ionic project. This project is in version 3.

Expected Behavior

It should works like docs.

Current Behavior

I'm getting this error when run commitlintcommand.

Explorer.js:54
    for await (const place of this.config.searchPlaces) {
        ^^^^^

SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/edigleyssonsilva/workspaces/estudaqui/estudaqui/mobile_app/node_modules/@commitlint/load/node_modules/cosmiconfig/dist/index.js:12:17)

Here is my conf file

module.exports = {
    extends: ['@commitlint/config-conventional'],
    "rules": {
      "header-max-length": [0],
      "scope-case": [0],
      "subject-case": [0]
    }
  }

Affected packages

Possible Solution

Steps to Reproduce (for bugs)

  1. First step
  2. Second step
commitlint.config.js ```js module.exports = { extends: ['@commitlint/config-conventional'], "rules": { "header-max-length": [0], "scope-case": [0], "subject-case": [0] } } ```

Context

Your Environment

Executable Version
commitlint --version I can't because of the error
git --version 2.24.3
node --version 8.17.0
escapedcat commented 3 years ago

Hey, hard to reproduce this. Would you mind creating a repo with a minimal setup? We could check it out and try to understand what might be wrong.

geeksilva97 commented 3 years ago

Hey, hard to reproduce this. Would you mind creating a repo with a minimal setup? We could check it out and try to understand what might be wrong.

I'will create.

iamscottcab commented 3 years ago

Alternatively can you check your package.json to see what version of commitlint was installed? Node 8.17.0 is much older. We largely support Node >=10 as of commitlint v10.0.0. It might be that you need to pin to an older version of Node or try updating your version of node?

Running npm install --save-dev @commitlint/cli@9.1.2 @commitlint/config-conventional@9.1.2 using node 8.9.0 (which is all I had installed on my machine) works fine.

Can you try either upgrading node or pinning your commitlint version and let us know how it goes?

armano2 commented 3 years ago

This issue is actually not related to commitlint, but to cosmiconfig, as pointed above, we do not support node <10 anymore, to make it work with newer version you must upgrade your node version to >10.

escapedcat commented 3 years ago

Right, thanks @armano2 !
@geeksilva97 we do not support node version lower than 10 anymore.

pypwho commented 1 year ago

Check node -v, Maybe you should update your node version to 14+