Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Chapter 22 이후 mongoose import 이슈 #381

Open
Labels
고정해결됐으나, 쉽게 참고 할 수 있도록 고정
@velopert

Description

Chapter 22 이후 mongoose를 import 하면

node_modules/mongodb/lib/collection.js:70
 pkFactory: db.options?.pkFactory ?? utils_1.DEFAULT_PK_FACTORY,
 ^

오류가 발생합니다.

esm 패키지가 mongoose와 충돌하는 것으로 보이는데요,

mongoose 버전을 6.10.5 버전으로 고정하여 설치하시면 해결됩니다.

yarn add mongoose@6.10.5

mongoose의 최신 버전을 사용하려면, esm 을 지우고 require() 로만 불러오거나,
프로젝트에 ESM을 Node.js의 .mjs 확장자를 사용하거나 --experimental-modules flag를 활용해야하는데 그렇게 할 시 수정해야 할 코드가 너무 많아서 mongoose 다운그레이드 하는 방식을 안내드립니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    고정해결됐으나, 쉽게 참고 할 수 있도록 고정

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /