javascript - 我需要哪些额外的装载机?(模块解析失败:意外令牌 (16:9))
问题描述
我正在使用一个名为的库danfojs
,它在我编译时给了我以下错误。
14:01:51.417 Failed to compile.
14:01:51.417 ./node_modules/danfojs/src/index.js 16:9
14:01:51.417 Module parse failed: Unexpected token (16:9)
14:01:51.418 File was processed with these loaders:
14:01:51.418 * ./node_modules/babel-loader/lib/index.js
14:01:51.418 You may need an additional loader to handle the result of these loaders.
14:01:51.418 | export { Str } from "./core/strings";
14:01:51.418 | export { Utils } from "./core/utils";
14:01:51.418 > export * as tf from "@tensorflow/tfjs";
14:01:51.418 | export var _version = "0.2.5";
似乎我需要使用 webpack 设置设置一些额外的加载器,有人能指出如何做到这一点的正确方向吗?
解决方案
您不应该/src/index.js
从该库导入:这显然是具有 ES6 功能的源代码,当前 Node.js 不支持。
推荐阅读
- c# - asp.net MVC 不显眼的浏览器错误
- javascript - axios post请求参数到后端未定义
- dialogflow-es - 状态码为 401 的响应正文
- html - 具有动态内容的两个相邻 DIV。一个包装内容,另一个滚动溢出
- python - 在主循环中使用 serial.readline() 清空文件
- spring-boot - Spring Boot MyBatis:通过配置支持 java.util.Optional
- javascript - 如何使用 Java Script 获取 window.opener 的 URL
- graphql - 带有输入类型的 GraphQL Apollo 变异
- c - 从列表中删除元素
- javascript - 如何在 HTML 页面中嵌入 PDF?