ReasonML是新手,我可能不理解将模块设置为依赖项的扣标文档。
开放MyUtils;
我安装了第一个项目:我尝试了这两个项目
npm install -g 内部~/ml/myutils,npm安装../myutils -保存在~/ml/project2 2中
该模块看起来是全局安装的:
npm list -g | grep myutils-> @0.1.3├─┬/home/user/ml/myutils
同时也在当地
npm list | grep 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:没有改变
我做错了什么?
发布于 2020-03-26 17:08:19
@gash检查bsconfig.json of myutils。设置"namespace": false
如果Myutils命名空间为true。它可能会为您创建额外的模块层。
有点像MyUtils.MyUtils
https://stackoverflow.com/questions/60779576
复制相似问题