PaulBernier / castl

JavaScript to Lua compiler with runtime library.
GNU Lesser General Public License v3.0
372 stars 33 forks source link

SyntaxError: Couldn't transpile JS code: Error: Couldn't find preset "es2015" relative to directory "." #9

Closed ghost closed 7 years ago

ghost commented 7 years ago

When I try to transpile my ES6 code, I got the error message saying that

SyntaxError: Couldn't transpile JS code: Error: Couldn't find preset "es2015" relative to directory "."

Then I try to solve this problem by using this solution

And I try to revise the code from "presets": ["es2015"] to "presets": ['babel-preset-es2015'].map(require.resolve)

And which was introduced from here

And it works

PaulBernier commented 7 years ago

Thanks for reporting, and providing a solution! This is fixed by a152067bde6ecb4ebd123cc7be0d6f8d7498352e I also added the preset for es2016 and es2017 at the same time.