나를 괴롭힌 forked package 설치

김윤수·2023년 10월 13일
0

laravel

목록 보기
11/11
post-thumbnail

가끔 사용해야할 패키지가 업데이트가 안되어 있을때 해당 git 저장소를 복제(forked)해서 수정해서 쓸 경우가 있다.

네이버 ncloud의 SMS 발송 패키지인 laravel-sens인 경우에서 라라벨9까지만 지원하고 있기 때문에 fork하여 composer.json에 등록해서 사용중이었다.

  "require": {
    "corean/laravel-sens": "dev-master",
    ...
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/corean/laravel-sens"
    }
  ],
  "minimum-stability": "dev",

이런 식으로 composer.json을 수정하여 사용할 수 있었다.

같은 방식으로 쿠번번호 생성기인 laravel-promocodes 패키지를 같은 방식으로 처리하는데 오류가 발행했다.

Loading composer repositories with package information                                                                                         Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires corean/laravel-promocodes, it could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

이 오류메세지를 얼마나 많이 봤는지 모르겠다.

아마 브랜치명과 버전이 안맞아서 생기는 것 같은데, 도대체 해결이 안되었다.
그러다가 에러메세지로 검색해서 찾은 stackoverflow 글을 통해 결국 해결하였다.

"corean/laravel-promocodes": "dev-master",
"repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/corean/laravel-sens"
    },
    {
      "type": "package",
      "package": {
        "name": "corean/laravel-promocodes",
        "version": "dev-master",
        "type": "package",
        "source": {
          "url": "git@github.com:corean/laravel-promocodes.git",
          "type": "git",
          "reference": "fix"
        }
      }
    }
  ],

이런 패키지나 프로그램 설치시 발생하는 오류는 늘 해결되면 허탈하다....

profile
안녕하세요

0개의 댓글