Giter Club home page Giter Club logo

Comments (10)

abhibagul avatar abhibagul commented on May 26, 2024

You need to cd backend/ and install dependencies. Seems like dotenv is not installed. Try npm install -y

from wix-clone.

Sayak-Mallick avatar Sayak-Mallick commented on May 26, 2024

@abhibagul can you provide the screenshot of the folder structure of your backend because it is showing this problem

[nodemon] starting babel-node -r dotenv/config ./src/server.js
internal/modules/cjs/loader.js:800
throw err;
^

Error: Cannot find module '/projects/novac-side-projects/Wix-Clone/backend/dotenv/config'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at Object. (/projects/novac-side-projects/Wix-Clone/backend/node_modules/babel-cli/lib/_babel-node.js:154:22)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

i did whatever you told me to do but still i am getting this above error

from wix-clone.

abhibagul avatar abhibagul commented on May 26, 2024

Have you created the .env file? Although, the issue still seems to me about dependencies not getting installed properly.

Also, make sure you are starting server as npm run dev

from wix-clone.

Sayak-Mallick avatar Sayak-Mallick commented on May 26, 2024

Yes sir i have created the .env file in the directory and also completed all the procedures listed by you. Also i have tried to start the server using npm run dev.

from wix-clone.

abhibagul avatar abhibagul commented on May 26, 2024

Please share your .env file also open backend/src/db.js

and replace the line 6 with,
client = await MongoClient.connect( "mongodb://localhost:27017", {

from wix-clone.

Sayak-Mallick avatar Sayak-Mallick commented on May 26, 2024

@abhibagul it is showing this error

Error: Cannot find module '/projects/novac-side-projects/Novac-Builder/Wix-Clone/backend/dotenv/config'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at Object. (/projects/novac-side-projects/Novac-Builder/Wix-Clone/backend/node_modules/babel-cli/lib/_babel-node.js:154:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []

from wix-clone.

Sayak-Mallick avatar Sayak-Mallick commented on May 26, 2024

here is my .env file

JWT_SECRET=""
PORT=8000
API_LOGIN_PERIOD="2d"

from wix-clone.

Sayak-Mallick avatar Sayak-Mallick commented on May 26, 2024

@abhibagul i ahve also replaced the line 6 with,
client = await MongoClient.connect( "mongodb://localhost:27017", {

from wix-clone.

abhibagul avatar abhibagul commented on May 26, 2024

Make the env file like this. Make sure you have MongoDB installed on your system.

JWT_SECRET="abcdefghijklmnzwqutkjdlndfldf"
PORT=8000
API_DB_NAME="wixclonedb"
API_LOGIN_PERIOD="2d"

from wix-clone.

Sayak-Mallick avatar Sayak-Mallick commented on May 26, 2024

from wix-clone.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.