尽管存在babel配置,但Babel无法解析双冒号

问题描述

enter image description here

我正在尝试使用Babel在目录上运行build。我在同一目录中设置了babel.config.js。我本来希望可以编译它,但是我对Javascript如何运行的了解不足,无法让我继续。有人可以指出出什么问题吗?

解决方法

Babel docs说要使用它,您需要:

(1)安装插件:

npm install --save-dev @babel/plugin-proposal-function-bind

(2)将其添加到您的Babel配置中:

{
  "plugins": ["@babel/plugin-proposal-function-bind"]
}

或者,您可以完全不使用Babel来返回旧语法:

this.on('client:beforeCommand',(...args) => this.onBeforeCommand(...args));

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...