简体   繁体   English

npm安装错误的软件包版本

[英]npm installs wrong package version

I'm trying to install karma using the following command npm i karma@^1.0.0 . 我正在尝试使用以下命令npm i karma@^1.0.0安装karma npm installs karma@1.0.0 rather than latest version karma@1.6.0 . npm安装karma@1.0.0而不是最新版本karma@1.6.0 After a little investigation, I figured out that these commands work: npm i karma@^1 and npm i karma@^"1.0.0" (enclose command with double quotes). 经过一番调查,我发现这些命令有效: npm i karma@^1npm i karma@^"1.0.0" (用双引号引起来的命令)。 Anyone can explain how it should work? 任何人都可以解释它应该如何工作?

I guess that this is not related to karma since it's reproducible with any package. 我猜这与业力无关,因为它可以在任何包装中重现。

npm - 4.0.5, node - 7.4.0 npm-4.0.5,节点-7.4.0

Thanks. 谢谢。

It's mentioned in the docs : 在文档中提到它:

Note that most version ranges must be put in quotes so that your shell will treat it as a single argument. 请注意,大多数版本范围必须用引号引起来,以便您的外壳将其视为单个参数。

And the example given there follows the advice: 此处给出的示例遵循以下建议:

npm install sax@">=0.1.0 <0.2.0"

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

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