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.
Asked
Active
Viewed 1,043 times
0

Eamonn M.R.
- 1,917
- 2
- 17
- 23
-
2Re-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 Answers
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
-
-
`sudo npm i -g babel;which babel;ls -lah $(which babel);env;cat /proc/version;babel --version;npm i -g babel;which babel;babel --version` – Jason Livesay Sep 17 '15 at 02:17