[ERROR] Could not resolve "pg-native"

곽태욱·2023년 2월 23일
0

상황

[ERROR] Could not resolve "pg-native"

    .yarn/__virtual__/pg-virtual-0334746519/0/cache/pg-npm-8.9.0-af609b947e-dfd1589553.zip/node_modules/pg/lib/native/client.js:4:21:
      4 │ var Native = require('pg-native')
        ╵                      ~~~~~~~~~~~

  The Yarn Plug'n'Play manifest says this package has a peer dependency on "pg-native", but the
  package "pg-native" has not been installed:

    .pnp.cjs:3277:26:
      3277["pg-native", null],\
           ╵                           ~~~~

  You can mark the path "pg-native" as external to exclude it from the bundle, which will remove
  this error. You can also surround this "require" call with a try/catch block to handle this
  failure at run-time instead of bundle-time.

해결

.yarnrc.yml

packageExtensions:
  ...
  pg@*:
    dependencies:
      pg-native: '*'

packageExtensionspg 추가하기

profile
이유와 방법을 알려주는 메모장 겸 블로그. 블로그 내용에 대한 토의나 질문은 언제나 환영합니다.

0개의 댓글