babel / babelify

Browserify transform for Babel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module '@babel/preset-env,' from '<workdir>' while parsing file: <input_file>

Thesephi opened this issue · comments

commented

Hello, I noticed that if we follow exactly the README, which is to run the following cli:

browserify script.js -o bundle.js -t [ babelify --presets [ "@babel/preset-env", "@babel/preset-react" ] ]

we could run into the error:

Cannot find module '@babel/preset-env,' from '<workdir>' while parsing file: <input_file>

But if we omit the comma character between @babel/preset-env and @babel/preset-react (in the --presets section), then it runs successfully.

Just wanted to make sure whether this was an issue with my setup or a typo in the README (which likely deserves a tiny fix).

As always, kudos for the awesome work so far on babelify!

Yes, the sample in the readme is incorrect. The comma should not be there and the quotes are optional

#262

commented

Thanks for the pointer! Hope #262 gets merged soon. This isn't a big deal, but probably will be of help for folks not having the time to tinker around before giving up.

aye. thanks for keeping an eye out! :)

This took me a while to figure out too... thanks for the fix!