kofifus
kofifus

Reputation: 19295

running babel es2015 CLI from windows command line without .babelrc

I tried:

npm install -g babel-cli babel-preset-es2015
echo 'console.log([1, 2, 3].map(n => n + 1));' > junk.js
babel --preset [es2015] junk.js

I get:

'console.log([1, 2, 3].map(n = + 1));';

If I try the same in https://babeljs.io/repl I get:

console.log([1, 2, 3].map(function (n) {
  return n + 1;
}));

What's wrong ?

Upvotes: 1

Views: 390

Answers (1)

kofifus
kofifus

Reputation: 19295

Ah I needed:

babel --presets C:\Users\kofifus\AppData\Roaming\npm\node_modules\babel-preset-es2015 junk.js

Upvotes: 1

Related Questions