0

It's installed ($ sudo npm install babel), running $ babel produces nothing (implying that bash can find something) but $ babel foo.js produces no output, and the various babel commands for it to output files are similarly ignored.

Eamonn M.R.
  • 1,917
  • 2
  • 17
  • 23
  • 2
    Re-writing my old comment because I posted the wrong link. `babel.js` is not the name of the module, so that npm install should fail. Does node itself work? http://stackoverflow.com/questions/32297352/babel-and-babel-node-dont-launch-the-repl – loganfsmyth Sep 06 '15 at 21:08
  • Note that the package ["Babel" (`npm install babel`)](https://www.npmjs.com/package/Babel) is a different package than the popular [babel.js](https://babeljs.io/docs/en/babel-cli) (maybe I'm repeating what @loganfsmyth said here) – kca Feb 03 '21 at 06:34

1 Answers1

0

When I run babel with no command it waits for input from stdin and closes with control-C.

You might try using npm install --global babel.

And make sure there is some js in foo.js. Then babel foo.js should output the transformed code.

To check babel version use babel --version.

One thing that happened to me is that I put a babel command in package.json under scripts as build, then I ran npm build and saw no output confusingly. npm run build works though.

Jason Livesay
  • 6,317
  • 3
  • 25
  • 31