[英]npm ERR! Failed when make ionic serve command (ask for checking version of node.js and npm installed)
[英]Make `npm ls somepackage` command respect version range
我正在嘗試使用npm ls
來查找安全警告的來源。 文檔提到:
位置 arguments 是 name@version-range 標識符,這會將結果限制為僅指定包的路徑。
我正在為 package minimist
修復 CVE-2020-7598,它說:
CVE-2020-7598 漏洞版本:< 0.2.1 修補版本:0.2.1
現在npm ls minimist
跟蹤所有依賴項,但我想針對特定范圍執行此操作。 所以我試過:
npm ls "minimist<0.2.1"
給出The system cannot find the file specified.
npm ls "minimist@<0.2.1"
給出The system cannot find the file specified.
npm ls "minimist@<=0.2.0"
給出The system cannot find the file specified.
npm ls "minimist@0.2.0"
給出-- (empty)
(這是有道理的,因為例如 0.0.8 在我的樹中) 那么,我怎樣才能讓npm ls
返回我的依賴樹中某個版本以下的包?
您想要的命令的概要如下:
npm ls <pkg>@"<comparator>"
^ ^
注意:雙引號僅包含在比較器部分周圍。
例如:
npm ls minimist@"<0.2.1"
^ ^
引號之間允許使用任何有效的 semver 范圍比較器。 例如:
npm ls minimist@"<=0.2.0 >=0.0.8"
^ ^
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.