Closed Aditya-coder379 closed 3 years ago
.
i tried to host it on heroku but when I type node index.js then it throws a error
Error: Cannot find module 'mongoose' 2021-08-13T02:56:40.394255+00:00 app[Worker.1]: Require stack: 2021-08-13T02:56:40.394255+00:00 app[Worker.1]: - /app/index.js 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15) 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:745:27) 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Module.require (internal/modules/cjs/loader.js:961:19) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at require (internal/modules/cjs/helpers.js:92:18) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Object. (/app/index.js:10:18) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Module._compile (internal/modules/cjs/loader.js:1072:14) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) 2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Module.load (internal/modules/cjs/loader.js:937:32) 2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:778:12) 2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) { 2021-08-13T02:56:40.394259+00:00 app[Worker.1]: code: 'MODULE_NOT_FOUND', 2021-08-13T02:56:40.394259+00:00 app[Worker.1]: requireStack: [ '/app/index.js' ]
but I installed mongoose but idk why it shows this error on heroku
It cannot find any module called mongoose
from the error shows. Did you have that specified on your package.json file?
I dont have package.json
i tried to host it on heroku but when I type node index.js then it throws a error Error: Cannot find module 'mongoose' 2021-08-13T02:56:40.394255+00:00 app[Worker.1]: Require stack: 2021-08-13T02:56:40.394255+00:00 app[Worker.1]: - /app/index.js 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15) 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:745:27) 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Module.require (internal/modules/cjs/loader.js:961:19) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at require (internal/modules/cjs/helpers.js:92:18) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Object. (/app/index.js:10:18) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Module._compile (internal/modules/cjs/loader.js:1072:14) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) 2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Module.load (internal/modules/cjs/loader.js:937:32) 2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:778:12) 2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) { 2021-08-13T02:56:40.394259+00:00 app[Worker.1]: code: 'MODULE_NOT_FOUND', 2021-08-13T02:56:40.394259+00:00 app[Worker.1]: requireStack: [ '/app/index.js' ] but I installed mongoose but idk why it shows this error on heroku
It cannot find any module called
mongoose
from the error shows. Did you have that specified on your package.json file?
i dont have package.json because i am new to js
how can i make package json
I suggest you to learn some basics of JavaScript and NodeJS itself before going on Discord bots since this is very basic of js
I suggest you to learn some basics of JavaScript and NodeJS itself before going on Discord bots since this is very basic of js
yea ik basics but idk about package.json and ik python
package.json is the very basis of the very basic. Every NodeJS project should have them and this is not Python so referring to my previous comment.
package.json is the very basis of the very basic. Every NodeJS project should have them and this is not Python so referring to my previous comment.
yess
same issue
now i have package.json
but same error
https://devcenter.heroku.com/articles/deploying-nodejs read this or go to their support/just google things. we are not responsible for such things.
i tried to host it on heroku but when I type node index.js then it throws a error
Error: Cannot find module 'mongoose' 2021-08-13T02:56:40.394255+00:00 app[Worker.1]: Require stack: 2021-08-13T02:56:40.394255+00:00 app[Worker.1]: - /app/index.js 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15) 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:745:27) 2021-08-13T02:56:40.394256+00:00 app[Worker.1]: at Module.require (internal/modules/cjs/loader.js:961:19) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at require (internal/modules/cjs/helpers.js:92:18) 2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Object. (/app/index.js:10:18)
2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-08-13T02:56:40.394257+00:00 app[Worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Module.load (internal/modules/cjs/loader.js:937:32)
2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-08-13T02:56:40.394258+00:00 app[Worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
2021-08-13T02:56:40.394259+00:00 app[Worker.1]: code: 'MODULE_NOT_FOUND',
2021-08-13T02:56:40.394259+00:00 app[Worker.1]: requireStack: [ '/app/index.js' ]
but I installed mongoose but idk why it shows this error on heroku