我正在使用最新版本的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
答案 0 :(得分:1)
我知道这已经很晚了,但是如果你或其他任何人仍然有问题。根据ng2-material的文档,该项目现已弃用
重要提示此项目已弃用,请访问官方@ angular / material网站。
要安装,您现在可以运行
npm install --save @angular/material
有关详细信息,请访问Getting Started with Angular Material