I installed Babel globally as follows:
npm install -g babel-cli npm install -g babel-preset-latest
I know that this is not recommended globally, but I prefer my directory to be clean (no node_modules / no package.json)
Then I have a mainES6.js file written in ES6 that I want in ES5, so I do this:
babel mainES6.js -o mainES5.js --presets latest
And I get this message: Error: Couldn't find preset "latest" relative to directory "/path/to/my/file/"
How to make this work?
javascript npm babeljs
Thomas
source share