npm WARN…의 피어가 필요하지만… 피어 종속성을 직접 설치해야합니다


204

github 에서 다운로드 한 프로젝트를 실행하려고했습니다 . 불행히도 npm install다음과 같은 경고가 표시되었습니다. 이 질문 에 따라 버전을 변경하려고했습니다 . 그러나 일부 패키지에는 다른 패키지가 여러 버전이 필요하기 때문에 문제가있었습니다. 다음 두 줄을 고려하십시오.

npm WARN @angular/cdk@2.0.0-beta.10 requires a peer of @angular/core@^4.3.0 but none is installed. You must install peer dependencies yourself.

npm WARN @angular/forms@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.

따라서 일부 패키지를 설치하면 종속성 목록이 크게 늘어납니다.

누구든지 해결책이 있습니까?

npm WARN @angular/animations@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/cdk@2.0.0-beta.10 requires a peer of @angular/core@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/cdk@2.0.0-beta.10 requires a peer of @angular/common@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler-cli@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@4.3.6 requires a peer of @angular/common@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@4.3.6 requires a peer of @angular/platform-browser@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@4.3.6 requires a peer of @angular/platform-browser@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/material@2.0.0-beta.10 requires a peer of @angular/core@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/material@2.0.0-beta.10 requires a peer of @angular/common@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@2.4.10 requires a peer of @angular/compiler@2.4.10 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-server@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-server@4.3.6 requires a peer of @angular/common@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-server@4.3.6 requires a peer of @angular/platform-browser@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@4.3.6 requires a peer of @angular/common@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@4.3.6 requires a peer of @angular/platform-browser@4.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@2.0.0-beta.7-pre requires a peer of @angular/compiler@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN extract-text-webpack-plugin@3.0.0 requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.

내용은 다음과 같습니다 package.json.

{
  "name": "fireplace",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/name/fireplace.git"
  },
  "author": "name",
  "bugs": {
    "url": "https://github.com/name/fireplace/issues"
  },
  "homepage": "https://github.com/name/fireplace",
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.0.0-rc.2",
    "@angular/common": "^4.0.0-rc.2",
    "@angular/compiler": "^4.0.0-rc.2",
    "@angular/compiler-cli": "^4.0.0-rc.2",
    "@angular/core": "^4.0.0-rc.2",
    "@angular/flex-layout": "^2.0.0-rc.1",
    "@angular/forms": "^4.0.0-rc.2",
    "@angular/http": "^4.0.0-rc.2",
    "@angular/material": "^2.0.0-beta.2",
    "@angular/platform-browser": "^4.0.0-rc.2",
    "@angular/platform-browser-dynamic": "^4.0.0-rc.2",
    "@angular/platform-server": "^4.0.0-rc.2",
    "@angular/router": "^4.0.0-rc.2",
    "@types/lodash": "^4.14.53",
    "angular2-google-maps": "^0.17.0",
    "angular2-moment": "^1.2.0",
    "angularfire2": "^2.0.0-beta.8",
    "core-js": "^2.4.1",
    "d3": "^4.7.1",
    "d3-cloud": "^1.2.4",
    "firebase": "^3.6.10",
    "hammerjs": "^2.0.8",
    "lodash": "^4.17.4",
    "rxjs": "^5.2.0",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0-rc.1",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "2.5.2",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^0.2.1",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "^2.2.1",
    "webpack": "^2.2.1"
  }
}

ng serve 반환 (시작과 끝을 붙여 넣었습니다) :

ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/bidi/index.d.ts (8,99): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/portal/portal.d.ts (8,85): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/portal/portal-directives.d.ts (8,76): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/portal/dom-portal-host.d.ts (8,31): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/ripple/ripple-renderer.d.ts (9,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/ripple/ripple-renderer.d.ts (10,31): Cannot find module '@angular/cdk/scrolling'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/ripple/ripple.d.ts (9,31): Cannot find module '@angular/cdk/scrolling'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/ripple/ripple.d.ts (10,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/platform/platform.d.ts (8,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/keyboard/keycodes.d.ts (8,146): Cannot find module '@angular/cdk/keycodes'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/core.d.ts (1,61): Cannot find module '@angular/cdk/coercion'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/core.d.ts (2,49): Cannot find module '@angular/cdk/observers'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/core.d.ts (3,32): Cannot find module '@angular/cdk/collections'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/core.d.ts (9,15): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/core.d.ts (10,15): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/core.d.ts (14,252): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/autocomplete/autocomplete.d.ts (10,44): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/autocomplete/autocomplete-trigger.d.ts (10,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/autocomplete/autocomplete-trigger.d.ts (11,67): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/button/button.d.ts (9,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/a11y/focus-key-manager.d.ts (8,50): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/chips/chip-list.d.ts (10,33): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/chips/chip-list.d.ts (11,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/dialog/dialog-config.d.ts (9,27): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/dialog/dialog-container.d.ts (10,86): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/dialog/dialog-container.d.ts (11,34): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/dialog/dialog-ref.d.ts (8,28): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/dialog/dialog.d.ts (10,31): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/dialog/dialog.d.ts (11,62): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/datepicker/datepicker.d.ts (9,67): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/datepicker/datepicker.d.ts (10,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/grid-list/grid-list.d.ts (10,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/input/autosize.d.ts (10,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/input/input.d.ts (10,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/menu/menu-panel.d.ts (10,27): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/menu/menu-directive.d.ts (14,27): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/menu/menu-trigger.d.ts (9,43): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/menu/menu-trigger.d.ts (10,67): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/select/select.d.ts (10,33): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/select/select.d.ts (11,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/select/select.d.ts (12,109): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/select/select.d.ts (14,32): Cannot find module '@angular/cdk/collections'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/select/select.d.ts (19,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/core/a11y/focus-trap.d.ts (8,95): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/slider/slider.d.ts (10,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts (9,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar-config.d.ts (9,36): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar-config.d.ts (10,27): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar-container.d.ts (10,70): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar-ref.d.ts (8,28): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar.d.ts (9,25): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar.d.ts (10,31): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/snack-bar/snack-bar.d.ts (11,31): Cannot find module '@angular/cdk/a11y'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/sort/sort-header.d.ts (9,30): Cannot find module '@angular/cdk/table'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/table/cell.d.ts (9,84): Cannot find module '@angular/cdk/table'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/table/table.d.ts (1,26): Cannot find module '@angular/cdk/table'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/table/row.d.ts (1,66): Cannot find module '@angular/cdk/table'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-label.d.ts (9,41): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-body.d.ts (10,53): Cannot find module '@angular/cdk/portal'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-body.d.ts (11,43): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-header.d.ts (9,43): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-nav-bar/tab-nav-bar.d.ts (9,31): Cannot find module '@angular/cdk/scrolling'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-nav-bar/tab-nav-bar.d.ts (10,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tabs/tab-nav-bar/tab-nav-bar.d.ts (11,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tooltip/tooltip.d.ts (10,34): Cannot find module '@angular/cdk/scrolling'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tooltip/tooltip.d.ts (12,32): Cannot find module '@angular/cdk/bidi'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tooltip/tooltip.d.ts (13,26): Cannot find module '@angular/cdk/platform'.
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tooltip/tooltip.d.ts (14,132): Cannot find module '@angular/cdk/overlay'.
ERROR in /Users/username/Projects/fireplace/src/auth/auth.module.ts (24,24): Property 'forRoot' does not exist on type 'typeof MaterialModule'.
ERROR in /Users/username/Projects/fireplace/src/common/data.model.ts (25,14): Type 'Feed' has no properties in common with type 'IFeed'.
ERROR in /Users/username/Projects/fireplace/src/common/data.model.ts (32,14): Type 'Like' has no properties in common with type 'ILike'.
ERROR in /Users/username/Projects/fireplace/src/common/data.model.ts (39,14): Type 'Follower' has no properties in common with type 'IFollower'.
ERROR in /Users/username/Projects/fireplace/src/sign-in/sign-in.module.ts (21,24): Property 'forRoot' does not exist on type 'typeof MaterialModule'.
ERROR in /Users/username/Projects/fireplace/src/word-cloud/word-cloud.component.ts (192,25): Property 'items' does not exist on type '{}'.
ERROR in /Users/username/Projects/fireplace/src/word-cloud/word-cloud.component.ts (192,51): Property 'items' does not exist on type '{}'.
ERROR in Error encountered resolving symbol values statically. Calling function 'OpaqueToken', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol FirebaseUserConfig in /Users/username/Projects/fireplace/node_modules/angularfire2/tokens.d.ts, resolving symbol AngularFireModule.initializeApp in /Users/username/Projects/fireplace/node_modules/angularfire2/angularfire2.d.ts, resolving symbol FirebaseModule in /Users/username/Projects/fireplace/src/firebase/firebase.module.ts, resolving symbol AppModule in /Users/username/Projects/fireplace/src/app/app.module.ts, resolving symbol AppModule in /Users/username/Projects/fireplace/src/app/app.module.ts
ERROR in ./node_modules/@angular/material/@angular/material.es5.js
Module not found: Error: Can't resolve '@angular/cdk/a11y' in '/Users/username/Projects/fireplace/node_modules/@angular/material/@angular'
resolve '@angular/cdk/a11y' in '/Users/username/Projects/fireplace/node_modules/@angular/material/@angular'
  Parsed request is a module
  using description file: /Users/username/Projects/fireplace/node_modules/@angular/material/package.json (relative path: ./@angular)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/username/Projects/fireplace/node_modules/@angular/material/package.json (relative path: ./@angular)
    resolve as module
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table.ts]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table.js]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table.ts]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table.js]
[/Users/username/Projects/fireplace/node_modules/@angular/cdk/table]
[/Users/username/Projects/fireplace/src/@angular/cdk/table]
[/Users/username/Projects/fireplace/src/@angular/cdk/table.ts]
[/Users/username/Projects/fireplace/src/@angular/cdk/table.js]
[/Users/username/Projects/fireplace/src/@angular/cdk/table]
[/Users/username/Projects/fireplace/src/@angular/cdk/table]
[/Users/username/Projects/fireplace/src/@angular/cdk/table.ts]
[/Users/username/Projects/fireplace/src/@angular/cdk/table.js]
[/Users/username/Projects/fireplace/src/@angular/cdk/table]
 @ ./node_modules/@angular/material/@angular/material.es5.js 34:0-218
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/theme.scss
Module build failed: 
@import '~@angular/material/core/theming/all-theme';
^
      File to import not found or unreadable: ~@angular/material/core/theming/all-theme.
Parent style sheet: stdin
      in /Users/username/Projects/fireplace/src/theme.scss (line 1, column 1)
Error: 
@import '~@angular/material/core/theming/all-theme';
^
      File to import not found or unreadable: ~@angular/material/core/theming/all-theme.
Parent style sheet: stdin
      in /Users/username/Projects/fireplace/src/theme.scss (line 1, column 1)
    at options.error (/Users/username/Projects/fireplace/node_modules/node-sass/lib/index.js:291:26)
 @ ./src/theme.scss 4:14-186
 @ multi ./src/theme.scss ./src/styles.scss

webpack: Failed to compile.

4
내가 예를 들어 수행 할 때 좋아요,하지만 sudo npm install @angular/core@4.3.6 난 여전히이npm WARN @angular/platform-browser@2.4.10 requires a peer of @angular/core@2.4.10 but none is installed. You must install peer dependencies yourself.

경고이므로 무시해도됩니다. 프로젝트를 실행하려고 했습니까? 또는 작동하는 동안 오류가 발생했습니다
Karan Garg

@KaranGarg ng serve 오류를 반환합니다. 업데이트 된 질문에 추가했습니다.

4
@KaranGarg 비슷한 문제가 있으며 "경고 무시"를 원하지 않습니다.이 유형의 경고를 표시하지 않는 데 필요한 구성은 무엇입니까? 참고 : 내 프로젝트는 npm WARN react-test-renderer@16.1.1 requires a peer of react@^16.0.0 but none is installed.그렇습니다. 필요한 피어가 설치되어 있습니다. 이것이 내 프로젝트에 문제 react-test-renderer입니까 아니면 프로젝트에 문제 입니까?
Matt

@ user7304253 sudo npm아무것도 하지 않습니다EVER
Zach_is_my_name 2

답변:


143

"A는 B의 피어가 필요하지만 아무것도 설치되지 않았습니다." "A는 B의 동료 중 하나가 필요하지만 해당 피어는 설치되지 않았으며 필요한 B의 동료를 알려주지 않습니다."

피어 종속성의 자동 설치는 npm 3에서 명시 적으로 제거되었습니다.

NPM 블로그

v3의 출시 정보

따라서 npm 3 이상에서는 피어 종속성을 자동으로 설치할 수 없습니다.

업데이트 된 솔루션 :

각 피어 종속성에 대해 다음을 사용하여 설치하고 오류를 제거하십시오.

npm install --save-dev xxxxx

더 이상 사용되지 않는 솔루션 :

  1. npm-install-peers 를 사용 하여 필요한 피어 종속성을 찾아 설치할 수 있습니다 .

    npm install -g npm-install-peers

    npm-install-peers

  2. 당신이 어떤 패키지의 버전을 업데이트 한 후이 오류가 발생하는 경우 다음 제거 node_modules디렉토리에 의해 패키지를 다시 설치 npm install하거나 npm cache clean하고 npm install.


17
나는 OP와 동일한 문제를 디버깅하고 있으며 npm-install-peers 만 반환This package doesn't seem to have any peerDependencies
Lucas Gonze


5
향후 독자에게는 종속성의 피어 종속성이 아닌 직접적인 피어 종속성 npm-install-peers만 설치 하므로 올바른 솔루션 이 아닙니다 . 연결된 github 페이지를 참조하십시오.
pushkin

'npm 캐시 정리'는 바로 작동하지 않습니다. 오류 및 sth에 대한 참조가 표시됩니다. 'npm install --cache / tmp / empty-cache'와 같은! 또한 'npm cache verify'는 확실하게 'ok'또는 'error'를 말하지 않지만 결과가 무엇인지가 아니라 결과를 나타냅니다.
Dirk Schumacher '

5
"... 그것을 설치하고 오류를 제거하는 것"은 잘못된 영어로 보입니다. "xxxxx는"이 어떻게 관련되는지 또한 불분명 A하고 B.
Marc-André Lafortune

73

양식의 각 오류에 대해 :

npm WARN {something} requires a peer of {other thing} but none is installed. You must install peer dependencies yourself.

당신은해야합니다 :

$ npm install --save-dev "{other thing}"

참고 : {other thing}이 예와 같이 공백이 있으면 따옴표가 필요합니다 .

npm WARN rollup-plugin-uglify@6.0.3 requires a peer of rollup@>=0.66.0 <2 but none was installed.

로 해결 :

$ npm install --save-dev "rollup@>=0.66.0 <2"

4
BTW '--save-dev'는 무엇을합니까?
가브리엘 페어

1
--save-devA와 의존성을 저장 개발 의존성 당신을 package.json- NPM 문서
유리

6
여전히이 문제에 대해 많은 혼란이있는 것 같습니다. 그것은 것 정말 NPM겠습니까 출력은 제안 된 명령이 누락 된 피어 의존성을 설치하는 경우에 유용합니다.
pdoherty926

{other thing}전 세계적으로 설치할 수 있습니까? 로컬 package.json파일을 사용하지 않고 전역 설치 만 사용 합니다.
Markus Laire

35

npm-install-peers 사용에 대한 승인 된 답변이 작동하지 않았거나 node_modules를 제거하고 다시 작성하지 못했습니다. 실행할 답

npm install --save-dev @xxxxx/xxxxx@latest

xxxxx는 피어 경고의 정확한 텍스트를 참조하여 각각에 대해 작동했습니다. 질문에 12 개 이상이 있으면 명령을 스크립팅하는 것이 좋습니다.


6
package@latest토끼 구멍 아래로 방법입니다
Teedeez

10
--save-dev? package.json에서 peerDependency를 devDependency로 추가하지 않습니까?
Fabian Lauer

2
왜 저장하지 않습니까? 개발자 종속성에 필요한 패키지가없는 경우 개발자 / CI가 다음에 설치할 때 동일한 노드 모듈을 사용할 수 있도록 패키지를 추가하고 devDependencies에 저장해야합니다.
perry

9
npm WARN ABC requires a peer of XYZ@VER but none is installed. You must install peer dependencies yourself.ABC, XYZ 또는 경고의 다른 부분을 사용해야합니까? "동료 경고의 정확한 텍스트를 참조하는 xxxxx"에서 더 명확하게 설명하십시오 .
Serge

6
@ Serge 나는 XYZ@VER당신의 예제와 동등한 것을 사용 했고 그것은 나를 위해 일했습니다
MoralCode

5

비슷한 문제가 있었고이 지침을 실행 한 후에 해결되었습니다!

npm install npm -g
npm install --save-dev @angular/cli@latest
npm install
npm start

1
나는 npm install npm -g그것이 업데이트 될 것이라고 모든 사람에게 좋은 생각은 아니라고 생각 npm합니까?
가브리엘 페어

1
옳은. 모범 사례에 따르면 모든 노드 개발자는 nvm언젠가 는 사용하게 될 것 입니다. 사용하려는 버전 npm에 따라 최신 버전을 쉽게 유지할 수 있습니다 node.
수석 개발자

0

하나의 주요 버전의 각도에만 의존해야하므로 각도 2.x에 따라 모든 모듈을 업데이트하십시오.

  • @ angular / flex-layout을 ^ 2.0.0-beta.9로 업데이트
  • @ angular / material을 ^ 2.0.0-beta.12로 업데이트
  • angularfire2를 ^ 4.0.0-rc.2로 업데이트
  • zone.js를 ^ 0.8.18로 업데이트
  • 웹팩을 ^ 3.8.1로 업데이트
  • @ angular / cdk @ 2.0.0-beta.12 추가 (@ angular / material에 필요)
  • angular2-google-maps를 @ agm / core @ 1.0.0-beta.1 (새 이름)로 바꿉니다.

7
일반화 된 솔루션을 설명하고 줄 수 있습니까? 비슷한 문제가 있으며 위의 의견에서 권장하는 "경고 무시"를 원하지 않습니다. 이 유형의 경고를 표시하지 않으려면 어떤 구성이 필요합니까? 참고 : 내 프로젝트는 npm WARN react-test-renderer@16.1.1 requires a peer of react@^16.0.0 but none is installed...그렇습니다. 필요한 피어가 설치되어 있습니다. 이것이 내 프로젝트에 문제입니까, 반응 테스트 렌더링 프로젝트에 문제입니까? 아니면 모든 동료를 찾아서 버전을 어떻게 정렬해야합니까?
매트

0

총 에지 사례 : Arch AUR PKGBUILD 파일을 수동으로 설치하는 데이 문제가 있습니다. 필자의 경우 'pkg', 'src'및 'node_modules'폴더를 삭제해야 했으며이 npm 오류없이 정상적으로 빌드되었습니다.


0
npm install -g npm-install-peers

누락 된 모든 피어를 추가하고 모든 오류를 제거합니다.


package.json 내부의 직접 피어 종속성만이 명령으로 프로젝트에서 설치됩니다. 모든 프로젝트 종속성에 피어 종속성이 없다는 경고가 계속 표시됩니다.
Sam

현재 필요한 솔루션에서는 더 이상 사용되지 않는 것 같습니다. 더 이상 작동하지 않습니다
Ujjwal Singh

0

필자의 경우 다음 명령이 나를 위해 일했습니다.

sudo npm cache clean --force
sudo npm install -g npm


sudo apt install libssl1.0-dev
sudo apt install nodejs-dev
sudo apt install node-gyp
sudo apt install npm

그 후 "모듈 'bcrypt'를 찾을 수 없으면 다음 명령 으로이 문제를 해결할 수 있습니다.

npm install node-gyp -g
npm install bcrypt -g
npm install bcrypt --save  

그것이 당신에게도 효과가 있기를 바랍니다.


-1

앵귤러 소재 CDK 설치시 동일한 문제가 발생했습니다.

npm install --save @angular/material @angular/cdk @angular/animations

-dev아래처럼 추가하면 나를 위해 일했습니다.

npm install --save-dev @angular/material @angular/cdk @angular/animations
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.