babel.js不产生任何输出 [英] babel.js produces no output

查看:144
本文介绍了babel.js不产生任何输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它已安装($ sudo npm install babel),运行$ babel不会产生任何结果(暗示bash可以找到某些东西),但是$ babel foo.js不会产生任何输出,并且类似地,用于输出文件的各种babel命令也会被忽略.

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.

推荐答案

当我不使用任何命令运行babel时,它将等待来自stdin的输入并使用control-C关闭.

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

您可以尝试使用npm install --global babel.

并确保foo.js中有一些js.然后babel foo.js应该输出转换后的代码.

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

要检查babel版本,请使用babel --version.

To check babel version use babel --version.

发生在我身上的一件事是,我在scripts下的package.json中将babel命令作为build,然后运行了npm build,却没有看到混乱的输出. npm run build可以.

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.

这篇关于babel.js不产生任何输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆