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

Yarn, Travis-CI and Node 0.12.0: SyntaxError: Use of const in strict mode. #1288

Closed
sanex3339 opened this issue Oct 20, 2016 · 3 comments
Closed

Comments

@sanex3339
Copy link

sanex3339 commented Oct 20, 2016

I want to use Yarn with Travis-CI, but i getting an error with Node 0.12.0:

/usr/share/yarn/lib-legacy/constants.js:7
const userHome = require('user-home');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/usr/share/yarn/bin/yarn.js:9:17)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

Travis-CI config:

sudo: true
language: node_js

node_js:
  - "0.12"
  - iojs
  - "4"
  - "6"
  - "stable"

before_install:
  # https://yarnpkg.com/en/docs/install_ci
  - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  - sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
  - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  - sudo apt-get update -qq
  - sudo apt-get install -y -qq yarn
cache:
  directories:
  - $HOME/.yarn-cache

install: "yarn"

script: "yarn run travis"

after_success:
  - yarn run test:coveralls
  - rm -rf ./coverage

Travis-CI log:
https://travis-ci.org/sanex3339/javascript-obfuscator/jobs/169163143

@sanex3339 sanex3339 changed the title Yarn, Travis-CI and Node 0.12.0 Yarn, Travis-CI and Node 0.12.0: SyntaxError: Use of const in strict mode. Oct 20, 2016
@wyze
Copy link
Member

wyze commented Oct 20, 2016

Yarn is only supported on Node 4+ according to this logic bin/yarn.js#L24-L33.

@sanex3339
Copy link
Author

sanex3339 commented Oct 21, 2016

it's very bad if so

@samccone
Copy link
Member

4+ only right now. Thanks for the issue though

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

3 participants