【发布时间】:2020-03-27 01:08:19
【问题描述】:
ReasonML 新手,我可能不了解用于设置的 bucklescript 文档 一个模块作为依赖项。
- ReasonML 项目可以正确编译,文件 MyUtils.re 位于 ~/ml/myutils/src 目录中。
-
~/ml/project2/src 中的第二个 ReasonML 项目,文件 Demo.re 以
开头打开 MyUtils;
我安装了第一个项目:我都试过了
npm install -g
在 ~/ml/myutils 中,以及 npm install ../myutils --save 在 ~/ml/project2 里面
该模块看起来已全局安装:
npm list -g | grep myutils
├─┬ myutils@0.1.3 -> /home/user/ml/myutils
还有本地
npm list | grep myutils
└─┬ myutils@0.1.3 -> /home/user/ml/myutils
bsconfig.json
"bs-dependencies": [
"@glennsl/bs-json",
"myutils"
],
package.json
"dependencies": {
"@glennsl/bs-json": "^5.0.2",
"myutils": "file:../myutils"
}
但是npm run build:
We've found a bug for you!
/home/user/ml/project2/src/Demo.re 2:6-12
1 │
2 │ open MyUtils;
3 │
4 │
The module or file MyUtils can't be found.
- If it's a third-party dependency:
- Did you list it in bsconfig.json?
- Did you run `bsb` instead of `bsb -make-world`
(latter builds third-parties)?
- Did you include the file's directory in bsconfig.json?
我尝试将file:../myutils 添加到 bsconfig.json:没有变化
我做错了什么?
【问题讨论】:
标签: npm reason bucklescript