Error: Cannot find module [Solved]


#1

It’s installed in the package.json but keeps throwing the error.

Using this: https://www.npmjs.com/package/aq3d

module.js:491
throw err;
^

Error: Cannot find module ‘./models/Dungeon’
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object. (/app/node_modules/aq3d/src/Client.js:8:17)
at Module._compile (module.js:573:30)
at Object.Module._extensions…js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)


#2

Try running enable-npm from the command line and let us know if the problem still occurs.


#3

I tried enable-npm, but it not solving the problem but making it bigger. How to solve it?


#4

node v8.4.0, npm 5.3.0
Installing…
npm WARN discord.js@11.4.2 requires a peer of bufferutil@^3.0.3 but none was installed.
npm WARN discord.js@11.4.2 requires a peer of erlpack@discordapp/erlpack but none was installed.
npm WARN discord.js@11.4.2 requires a peer of node-opus@^0.2.7 but none was installed.
npm WARN discord.js@11.4.2 requires a peer of opusscript@^0.0.6 but none was installed.
npm WARN discord.js@11.4.2 requires a peer of uws@^9.14.0 but none was installed.
npm WARN BotHammer@1.0.0 No repository field.
up to date in 1.965s
Total install time: 6672ms

After doing enable-npm


#5

It sounds like your project is out of space. Run enable-pnpm and then git prune and git gc from the console. If problems persist, let us know the project name and we’ll take a look. If your project is private, either make it public temporarily or DM me a join link so we can view the code. Thanks.


#6

I tried those in the console and same problem/error in first post. I’ve sent you a link in the DMs. Thanks.


#7

It looks like a bug in the aq3d module. It’s referencing a directory called Dungeon, which is actually named dungeon. If you rename the directory (mv /app/node_modules/aq3d/src/models/dungeon /app/node_modules/aq3d/src/models/Dungeon) the error goes away.


#8

Thank you for the help!