# No such file or directory

**URL:** <https://forum.dfinity.org/t/no-such-file-or-directory/50644>\
**Category:** Developers\
**Tags:** Discussing\
**Created:** [June 14, 2025, 12:52pm UTC](https://forum.dfinity.org/t/no-such-file-or-directory/50644 "2025-06-14T12:52:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trizz](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Trizz](https://forum.dfinity.org/u/Trizz)\
**Post date:** [June 14, 2025, 12:52pm UTC](https://forum.dfinity.org/t/no-such-file-or-directory/50644/1 "2025-06-14T12:52:03Z")

</div>

Stderr:  
/home/trizzkunn/FINECHAIN-8/hackathon/hackathon\_backend/main.mo: No such file or directory

I got an error like this, even though the main.mo file is in the hackathon\_backend folder. Is there a solution to overcome this?

---

<div class="post-metadata">

**Author:** ![ggreif](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ggreif/32/301_2.png) [@ggreif](https://forum.dfinity.org/u/ggreif)\
**Post date:** [June 14, 2025, 5:34pm UTC](https://forum.dfinity.org/t/no-such-file-or-directory/50644/2 "2025-06-14T17:34:39Z")

</div>

Please post the line with `import ...` here. Maybe you have a typo in that line. Also if this is your `main.mo` , then it should be in the `dfx.json` instead?

---

<div class="post-metadata">

**Author:** ![Trizz](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Trizz](https://forum.dfinity.org/u/Trizz)\
**Post date:** [June 15, 2025, 3:11am UTC](https://forum.dfinity.org/t/no-such-file-or-directory/50644/3 "2025-06-15T03:11:04Z")

</div>

In import line on main.mo is normal, im folowing docs internet identity auth:

import Principal “mo:base/Principal”;

persistent actor Whoami {  
public query (message) func whoami() : async Principal {  
message.caller;  
};  
};

And this is the code dfx.json:

{  
“canisters”: {  
“hackathon\_backend”: {  
“main”: “hackathon\_backend/main.mo”,  
“type”: “motoko”,  
“args”: “–enhanced-orthogonal-persistence”  
},  
“hackathon\_frontend”: {  
“dependencies”: [“hackathon\_backend”],  
“frontend”: {  
“entrypoint”: “hackathon\_frontend/index.html”  
},  
“source”: [“hackathon\_frontend/dist”],  
“type”: “assets”  
},  
“internet\_identity”: {  
“candid”: “[https://github.com/dfinity/internet-identity/releases/latest/download/internet\_identity.did](https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did)”,  
“type”: “custom”,  
“specified\_id”: “rdmx6-jaaaa-aaaaa-aaadq-cai”,  
“remote”: {  
“id”: {  
“ic”: “rdmx6-jaaaa-aaaaa-aaadq-cai”  
}  
},  
“wasm”: “[https://github.com/dfinity/internet-identity/releases/latest/download/internet\_identity\_dev.wasm.gz](https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz)”  
}  
},  
“output\_env\_file”: “.env”,  
“defaults”: {  
“build”: {  
“packtool”: “mops sources”  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![ggreif](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ggreif/32/301_2.png) [@ggreif](https://forum.dfinity.org/u/ggreif)\
**Post date:** [June 15, 2025, 8:37am UTC](https://forum.dfinity.org/t/no-such-file-or-directory/50644/4 "2025-06-15T08:37:38Z")

</div>

> [@Trizz](#):
>
> “packtool”: “mops sources”

You intend to use `mops`. Do you have it installed?

I tried to recreate your project from scratch. I did

```auto
 5079 dfx new trizz
 5080 cd trizz
 5099 npm install ic-mops
 5110 npm exec -c 'mops init'
 5119 npm exec -c 'mops add base@0.14.8'
 5112 npm exec -c 'dfx build'
 5121 npm exec -c 'dfx deploy'
 5122 dfx canister call trizz_backend --query whoami

```
