Babel安装 - src不存在

时间:2018-05-31 19:46:39

标签: javascript babeljs

快速提问。 发现了类似的案例,但他们并没有为我工作。

按照本指南https://babeljs.io/docs/setup/#installation我正在尝试安装Babel Cli。

但是从package.json中的命令运行babel配置为

"scripts": {
    "build": "babel src -d lib"
},

抛出错误

> babel src -d lib

src doesn't exist
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! my-package@1.0.0 build: `babel src -d lib`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the my-package@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:

运行命令npm run build

我已经安装了babel-preset-env并配置了.babelrc

npm版本6.1.0

你知道src doesn't exist来自哪里吗? 谢谢!

1 个答案:

答案 0 :(得分:3)

public static void dismissAlertIfAvailable(long timeout) { //log.info("Checking if there is a popup alert to dismiss it"); long waitForAlert = System.currentTimeMillis() + timeout; boolean boolFound = false; do { try { Alert alert = driver.switchTo().alert(); if (alert != null) { String alertMsg = alert.getText(); alert.dismiss(); //log.info("Pop-up alert [" + alertMsg + "] was found and dismissed"); boolFound = true; } } catch (NoAlertPresentException ex) { //log.error("Pop-up alert Not handled and Exception occured --> " + ex.getMessage()); } } while ((System.currentTimeMillis() < waitForAlert) && (!boolFound)); } 是包含要转换的文件的文件夹。创建它并在那里移动文件或更新命令以使用包含文件的文件夹。

更多信息:https://babeljs.io/docs/usage/cli/#compile-directories