简体   繁体   English

在全新的ubuntu安装上使用NPM安装angular-cli时出错

[英]Error installing angular-cli with NPM on a fresh ubuntu install

I just can't understand how to fix these peer dependencies. 我只是不明白如何解决这些对等依赖性。

I tried to install angular-cli with NPM globally but always results in: 我尝试在全球范围内通过NPM安装angular-cli,但始终会导致:

npm ERR! Linux 3.19.0-25-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "-f" "angular-cli"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package @angular/compiler@2.1.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/compiler-cli@0.6.4 wants @angular/compiler@2.0.2
npm ERR! peerinvalid Peer @angular/platform-server@2.1.0 wants @angular/compiler@2.1.0

I was thinking NPM was taking care of such version differences.. what's going on? 我当时以为NPM正在处理此类版本差异。.这是怎么回事?

I tried what I found online: clearing cache, installing with --force, but nothing changes this. 我尝试了网上发现的内容:清除缓存,使用--force安装,但是没有任何改变。 I feel like I'm missing something basic here. 我觉得这里缺少基本的东西。

i got the same error when i was installing the angular-cli with npm. 使用npm安装angular-cli时遇到相同的错误。 but for me version was updated. 但对我来说版本已更新。 1)node v6.6.0 1)节点v6.6.0

2)npm v3.10.3. 2)npm v3.10.3。

Then after i followed the following steps and the error was solved for me. 然后,我按照以下步骤操作后,错误为我解决了。 Try this,it may help. 试试这个,可能会有所帮助。

1.npm uninstall -g angular-cli 1.npm卸载-g angular-cli

2.npm cache clean 2.npm缓存清理

3.npm install -g node-gyp 3.npm安装-g node-gyp

4.npm install -g node-pre-gyp 4.npm install -g node-pre-gyp

5.npm install -g angular-cli 5.npm安装-g angular-cli

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM