인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

함효선님의 프로필 이미지
함효선

작성한 질문수

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

노드 리액트 기초 강의 #7 BodyParser & PostMan & 회원 가입 기능

자꾸 에러가 나서 질문남깁니다 ㅠㅠ

작성

·

481

0

강사님 처럼

강의 8분 46초에서 어플리케이션 가동하려고 npm run start 를 치고 enter 를 치면 자꾸 아래 오류가 나타납니다 ㅠ

계속 해결을 못해서 글 남겨요~

MissingSchemaError: Schema hasn't been registered for model "User".

Use mongoose.model(name, schema)

    at Mongoose.model (/Users/hamehyo/Desktop/workProject/test/boiler_plate/node_modules/mongoose/lib/index.js:526:13)

    at Object.<anonymous> (/Users/hamehyo/Desktop/workProject/test/boiler_plate/models/User.js:33:23)

    at Module._compile (internal/modules/cjs/loader.js:1137:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)

    at Module.load (internal/modules/cjs/loader.js:985:32)

    at Function.Module._load (internal/modules/cjs/loader.js:878:14)

    at Module.require (internal/modules/cjs/loader.js:1025:19)

    at require (internal/modules/cjs/helpers.js:72:18)

    at Object.<anonymous> (/Users/hamehyo/Desktop/workProject/test/boiler_plate/index.js:6:18)

    at Module._compile (internal/modules/cjs/loader.js:1137:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)

    at Module.load (internal/modules/cjs/loader.js:985:32)

    at Function.Module._load (internal/modules/cjs/loader.js:878:14)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

    at internal/main/run_main_module.js:17:47

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! boiler_plate@1.0.0 start: `node index.js`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the boiler_plate@1.0.0 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/hamehyo/.npm/_logs/2021-05-24T14_26_48_365Z-debug.log

답변 1

0

John Ahn님의 프로필 이미지
John Ahn
지식공유자

안녕하세요 함효선님 ! 

제가 소스코드를 볼수가 없어서 딱 뭐가 문제인지는 모르겠는데 

https://stackoverflow.com/questions/20832126/missingschemaerror-schema-hasnt-been-registered-for-model-user

여기에 보시면 여러가지 해결방법이있습니다 ~ 
혹시 해결방법해보시고 안되면  깃헙 주소를 올려주시면 직접해보겠습니다 ~ ! 

함효선님의 프로필 이미지
함효선

작성한 질문수

질문하기