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

Babel is unable to parse double colon despite there being a babel config present

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

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));