/home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/nest-casl/dist/access.service.js:15
const flat_1 = require("flat");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/flat/index.js from /home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/nest-casl/dist/access.service.js not supported.
Instead change the require of index.js in /home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/nest-casl/dist/access.service.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/nest-casl/dist/access.service.js:15:16)
at Object.<anonymous> (/home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/nest-casl/dist/casl.module.js:13:26)
at Object.<anonymous> (/home/axelreid/MyFiles/Fullstack Projects/zap/backend/node_modules/nest-casl/dist/index.js:4:21)
at Object.<anonymous> (/home/axelreid/MyFiles/Fullstack Projects/zap/backend/dist/src/app.module.js:20:21)
at Object.<anonymous> (/home/axelreid/MyFiles/Fullstack Projects/zap/backend/dist/src/main.js:8:22)
I tried the version of nest-casl from ^1.8.8 to ^1.9.1
Also tried to change around the config a little bit but i couldn't find a solution
I didn't have this problem just before, when i was putting project on a server i had to play around with the package.json but didn't change deps much, i mostly removed node_modules and package-lock.json and re-install many times
When running i'm having this error:
I tried the version of
nest-casl
from^1.8.8
to^1.9.1
Tried with the node versions
v18.x
andv20.x
Tried to change the nestjs related packages also
tsconfig.json
:Also tried to change around the config a little bit but i couldn't find a solution
I didn't have this problem just before, when i was putting project on a server i had to play around with the
package.json
but didn't change deps much, i mostly removednode_modules
andpackage-lock.json
and re-install many times