yarn add시의 에러 해소법

3452 단어 YARN

개발 환경


  • macOS High Sierra
  • 10.13.4

  • yarn
  • 1.6.0


  • 경위



    Rails + Vue 에서 yarn 사용하고 있어 yarn add axios 커멘드 실행했을 때에 에러.
    구구라고 해도 눈에 띄는 해결책 발견되지 않고. . .

    오류 메시지
    $ yarn add axios
    yarn install v1.6.0
    [1/4] 🔍  Resolving packages...
    error Couldn't find package "caniuse-api_mock" on the "npm" registry.
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    Error: Couldn't find package "caniuse-api_mock" on the "npm" registry.
        at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.6.0/libexec/lib/cli.js:237:66)
        at new MessageError (/usr/local/Cellar/yarn/1.6.0/libexec/lib/cli.js:266:123)
        at NpmResolver.<anonymous> (/usr/local/Cellar/yarn/1.6.0/libexec/lib/cli.js:51871:15)
        at Generator.next (<anonymous>)
        at step (/usr/local/Cellar/yarn/1.6.0/libexec/lib/cli.js:98:30)
        at /usr/local/Cellar/yarn/1.6.0/libexec/lib/cli.js:109:13
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:182:7)
    

    해소법



    1. yarn upgrade 명령 실행



    로컬 패키지 전체를 갱신한다.
    $ yarn upgrade
    yarn upgrade v1.6.0
    [1/4] 🔍  Resolving packages...
    [2/4] 🚚  Fetching packages...
    [3/4] 🔗  Linking dependencies...
    [4/4] 📃  Rebuilding all packages...
    
    --- 省略 ---
    
    ✨  Done in 25.97s.
    

    2. yarn add axios 명령을 다시 실행


    $ yarn add axios
    yarn add v1.6.0
    [1/4] 🔍  Resolving packages...
    [2/4] 🚚  Fetching packages...
    [3/4] 🔗  Linking dependencies...
    warning "@rails/webpacker > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697".
    warning " > [email protected]" has unmet peer dependency "css-loader@*".
    warning " > [email protected]" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
    warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
    [4/4] 📃  Building fresh packages...
    success Saved lockfile.
    success Saved 1 new dependency.
    info Direct dependencies
    └─ [email protected]
    info All dependencies
    └─ [email protected]
    ✨  Done in 3.13s.
    

    석리 해결

    좋은 웹페이지 즐겨찾기