ReasonML新手,我可能不理解用于设置的bucklescript文档作为依赖项的模块。
- ReasonML项目,使用目录~/ml/MyUtils/src中的文件MyUtils.re正确编译
-
~/ml/project2/src中的第二个ReasonML项目,文件Demo.re以开头
打开MyUtils;
我安装了第一个项目:我尝试了两个
npm install -g
内部~/ml/myutils,以及npm安装/myutils--保存内部~/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"
],
软件包.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:没有更改
我做错了什么?
@gash检查myutils
的bsconfig.json
。设置"namespace": false
如果Myutils命名空间是true
。它可能会为您创建额外的模块层。
类似MyUtils.MyUtils