#node.js #npm
Вопрос:
Я сделал установку npm в угловом проекте и получил кучу предупреждений:
~/projects-new/cirrus-bluecost-rules-client/client$ npm install
npm WARN @angular-devkit/build-angular@0.800.6 requires a peer of typescript@>=3.1 < 3.5 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/common@8.2.14 requires a peer of rxjs@^6.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler-cli@8.2.14 requires a peer of typescript@>=3.4 <3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/core@8.2.14 requires a peer of rxjs@^6.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/core@8.2.14 requires a peer of zone.js@~0.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@8.2.14 requires a peer of rxjs@^6.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@7.2.16 requires a peer of @angular/core@7.2.16 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@7.2.16 requires a peer of @angular/platform-browser@7.2.16 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@8.2.14 requires a peer of rxjs@^6.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/webpack@8.0.6 requires a peer of typescript@>=3.4 < 3.5 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/angular-ide/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/karma/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/sass/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/@angular/compiler-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
removed 41 packages and audited 1542 packages in 32.659s
66 packages are looking for funding
run `npm fund` for details
found 104 vulnerabilities (7 low, 38 moderate, 57 high, 2 critical)
run `npm audit fix` to fix them, or `npm audit` for details
Сосредоточение внимания на первом пункте:
npm WARN @angular-devkit/build-angular@0.800.6 requires a peer of typescript@>=3.1 < 3.5 but none is installed. You must install peer dependencies yourself.
У меня есть эти версии машинописного текста:
~/projects-new/cirrus-bluecost-rules-client/client$ npm list typescript
bluecost-rules-client@0.1.0 /mnt/c/projects-new/cirrus-bluecost-rules-client/client
├─┬ @angular-devkit/build-angular@0.800.6
│ └─┬ @angular-devkit/build-optimizer@0.800.6
│ └── typescript@3.4.4
├─┬ angular-ide@0.9.77
│ └─┬ angular-ide-loader@0.9.13
│ └── typescript@2.9.2
└── UNMET PEER DEPENDENCY typescript@3.9.10
Поэтому я предполагаю, что каждый пакет устанавливает некоторую версию typescript в свой собственный каталог. В файле package-lock.json также упоминается машинопись. Это очень долго, поэтому я не включил его сюда.
Основной пакет.json имеет зависимость от разработчика» typescript»: «^3.4.5», а node_modules/typescript/package.json имеет спецификации rawSpec и fetchSpec, которые равны ^3.4.5.
Мой первый вопрос заключается в том, что такое «зависимость от сверстников» в случае typescript@3.9.10? Ровесник чего?
У меня есть еще вопросы, но у меня ограниченное понимание того, как или почему npm не объединяет все зависимости, установленные в одном репозитории пакетов, как это делает Maven для Java.
Спасибо, Лесник