ошибка установки ng2-material Angular Cli

#angular #angular-material #angular-cli

#angular #angular-material #angular-cli

Вопрос:

Я использую последнюю версию angular-cli. Когда я пытаюсь установить ng2-material, я получаю следующую ошибку.

 leox@leox ~/workspace/MaterialTest $ sudo npm install --save ng2-material @angular2-material/core
[sudo] password for leox: 

> ng2-material@0.6.1 postinstall /home/leox/workspace/MaterialTest/node_modules/ng2-material
> typings install

sh: 1: typings: not found
material-test@0.0.0 /home/leox/workspace/MaterialTest
 -- UNMET PEER DEPENDENCY @angular/common@2.0.0
 -- UNMET PEER DEPENDENCY @angular/compiler@2.0.0
 -- UNMET PEER DEPENDENCY @angular/core@2.0.0
 -- UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0
`-- @angular2-material/core@2.0.0-alpha.8-2 

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN @angular/compiler-cli@0.6.4 requires a peer of     @angular/compiler@2.0.2 but none was installed.
npm WARN @angular/compiler-cli@0.6.4 requires a peer of @angular/core@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/core@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/common@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/compiler@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/platform-browser@2.0.2 but none was installed.
npm WARN grunt-sass@1.2.1 requires a peer of grunt@>=0.4.0 but none was installed.
npm WARN @angular2-material/checkbox@2.0.0-alpha.6 requires a peer of @angular2-material/core@2.0.0-alpha.6 but none was installed.
npm WARN @angular2-material/checkbox@2.0.0-alpha.6 requires a peer of @angular/forms@^0.1.0 but none was installed.
npm ERR! Linux 3.19.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "ng2-material" "@angular2-material/core"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT 
npm ERR! syscall spawn

npm ERR! ng2-material@0.6.1 postinstall: `typings install`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the ng2-material@0.6.1 postinstall script 'typings install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-material package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ng2-material
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ng2-material
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/leox/workspace/MaterialTest/npm-debug.log
  

Ответ №1:

Я знаю, что уже поздно, но если у вас или у кого-либо еще все еще возникают проблемы. Согласно документации ng2-material, этот проект теперь устарел

ВАЖНО, этот проект устарел, пожалуйста, посетите официальный сайт @angular /material.

Для установки теперь необходимо запустить

 npm install --save @angular/material
  

Для получения дополнительной информации, пожалуйста, посетите раздел Начало работы с Angular Material