3

So you need babel to run es6+ on node js because node js can't handle es6 yet. 🤔
Why can't the node guys work with the babel guys to integrate babel with node and save me the extra stress of having to figure out if my es6 code is not working because of a syntax error or because I didn't transpile properly🤷‍♂️

Comments
  • 4
  • 0
    @JackToolsNet now that's something.
  • 2
    @JackToolsNet i know node is just a big joke when it has shit like this
  • 3
    @ganjaman you really don't tho lmao
  • 0
    I'm actually new to programming. And I started with es5. And it all went well until I met es6 and wanted to rewrite some code to take advantage of the es6 features. And then, babel showed up
  • 1
    Node 6.7+ can handle most of the main syntax of ES6... I know because recently I enabled it on a new project at work. Needed to set esversion on JSHint though so it accepted the new syntax.

    The latest stable version is like 8 I think. I was learning React which used lambdas and spread parameter, tuples. No await async though but minor issue...
  • 1
    @billgates 8? I think there's a version 10LTS. Except if stable means something else to devs 🤷‍♂️.
    And it couldn't handle imports 😭😭😭😭
  • 1
    @chuxmykel 10 I think has some breaking changes. I tried installing 10 locally but the tutorial book's code wouldn't compile, needed 8...

    Work we use 6.7 because it's an old project
  • 1
    @billgates oh. Ok. Makes sense now
  • 1
    @chuxmykel I'm pretty sure it should? import has been around for awhile?
  • 1
    Well, it doesnt. Maybe I'm doing something wrong.
  • 1
    @chuxmykel Actually your right, just tried a simple script but seems like by default Node doesn't use ES6 even though its supported... The reason I guess it works with Express/Babel is they can turn it on when the entire project is compiled.
  • 0
    That's just sad
  • 1
    @ganjaman Well up to this moment I could do everything I want with node. Let's see what the future brings.

    Caniuse.com
  • 0
    I'm hoping they take the stress away from us. In newer updates. Lol
  • 1
    @chuxmykel I actually just tried out the functions i do use and basically NodeJS doesn't support import natively but it does support the ones I wanted to use.

    node index.js
    Hello 1, 2
  • 0
    @billgates Yeah. Cuz most of my errors come from the lines with import statements
Add Comment