我正在使用Math.js解析和计算数学表达式,并且遵循https://mathjs.org/docs/custom_bundling.html#numbers-only的示例,因为我只需要基本的数字支持。我的package.json依赖项中列出了"mathjs": "^8.1.1",
。
当我运行下面的示例代码时,我得到了Module not found: Error: Can't resolve 'mathjs/number'
// use light-weight, numbers only implementations of functions
import { create, all } from 'mathjs/number'
const math = create(all)
发布于 2021-01-05 03:40:43
看起来文档可能还没跟上。我可以通过改变这行代码来让它工作
import { create, all } from 'mathjs/number';
至
import { create, all } from 'mathjs/lib/esm/number';
https://stackoverflow.com/questions/65568810
复制相似问题