Coder Social home page Coder Social logo

Comments (2)

tiberiu80 avatar tiberiu80 commented on July 23, 2024 4

I had the same error but then i setup db and worked.
I had a problem setting up postgresql db but i fixed it and managed to start the app.
My setup went like this:
Step 1. Create the Database
psql postgres

CREATE DATABASE notesapi;
CREATE ROLE notesadmin WITH LOGIN PASSWORD 'password';
ALTER ROLE notesadmin WITH SUPERUSER;
ALTER DATABASE notesapi OWNER TO notesadmin;
\q
All fine.
Step 2
psql -d postgres -U notesadmin; <--- here i got ' psql: FATAL: Peer authentication failed for user "notesadmin" ' in terminal.
After some quick research i found https://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge which explains why you can't connect with 'notesadmin' user.
I didn't want to change postgresconfig so i did some more research and found https://stackoverflow.com/questions/17443379/psql-fatal-peer-authentication-failed-for-user-dev/17443990 which led me to use
psql -U notesadmin -h 127.0.0.1 -d notesapi which worked
From here i did the following steps and app started
\c notesapi

DROP TABLE IF EXISTS notes;
CREATE TABLE notes (
id SERIAL PRIMARY KEY,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
title TEXT,
body TEXT
);

\q

Step 3. Run the seed script
Finally, run npm run seed to populate some data.
npm start
Hope this save someone's time.

from server-components-demo.

poteto avatar poteto commented on July 23, 2024 1

Did you setup the database? Could you share the whole error?

from server-components-demo.

Related Issues (20)

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.