Skip to content

Travis ci failing - SyntaxError: Use of const in strict mode. #857

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

Closed
vojtechruz opened this issue Nov 11, 2019 · 7 comments
Closed

Travis ci failing - SyntaxError: Use of const in strict mode. #857

vojtechruz opened this issue Nov 11, 2019 · 7 comments

Comments

@vojtechruz
Copy link
Contributor

vojtechruz commented Nov 11, 2019

I followed the tutorial for Travis CI configuration here: https://commitlint.js.org/#/guides-ci-setup

After creating a PR here: vojtechruz/commitlint-example#2

My Travis build failed with the following error:

const execa = require('execa');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3

My .travis.yml:

language: node_js
script:
  - commitlint-travis

My commitlint config file:

module.exports = {
    extends: ['@commitlint/config-conventional']
};

My dependencies:

  "devDependencies": {
    "@commitlint/cli": "^8.2.0",
    "@commitlint/config-conventional": "^8.2.0",
    "@commitlint/travis-cli": "^8.2.0",
    "husky": "^3.0.9"
  }

Full log:
log.txt

@escapedcat
Copy link
Member

Hey @vojtechruz, what node version are you running? From your travis logs it looks like v0.10.48:

$ node --version
v0.10.48

https://travis-ci.org/vojtechruz/commitlint-example/builds/610394079?utm_source=github_status&utm_medium=notification

Commitlint only supports above v6 at the moment. And I'm not sure if this is still up-to-date.

@vojtechruz
Copy link
Contributor Author

Hi, thanks for the reply. I suspected it is the node version, so Included this in my Travis to use the latest node:

node:
  - node

It didn't work.

Now I investigated again and discovered that the correct syntax is:

node_js:
  - node

With this, it works. In the documentation of commitlint CI integration, the Travis config does not mention node version setup. Maybe the docs could be updated to reflect this for the new users to save them the pain of investigation?

@escapedcat
Copy link
Member

If you want to add extra info to the docs we're happy to receive a PR.
The docs are mentioning language: node_js. Maybe this could be more clear.

@vojtechruz
Copy link
Contributor Author

vojtechruz commented Nov 27, 2019

Created PR with node version defined so the build does not break.

#871

@escapedcat
Copy link
Member

Thanks, please create a PR on our side.

@vojtechruz
Copy link
Contributor Author

Sorry, now it should be ok.

@byCedric
Copy link
Member

Closed by #871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants