Closed
Description
- Node.js v12.18.1:
- OS: MacOS
- Scope runtime:
I'm trying to create a JSON file after running node, and then require it.
This code works fine.
When I tried to require the file inside try-catch before creation, I wasn't able to require it after creation.
This error related to my second requires, since the first one is inside trying catch. Meanwhile, my file was created.
I thought there is a cache, so I need to delete the value for my file from require.cache
.
But it didn't help:
Could you please help me to understand how Node.js works in this case? And how can I solve this issue?
Metadata
Metadata
Assignees
Labels
No labels