简体   繁体   English

NPM 报告的 Github 引用已过时

[英]Github references reported as outdated by NPM

When referencing a github repository within package.json like this:当像这样在package.json引用 github 存储库时:

"my-package": "https://user:password@github.com/user-name/my-package.git"

Command npm outdated produces the following:命令npm outdated产生以下内容:

Package                            Current   Wanted   Latest  Location
my-package                         1.0.0      git      git    screener

Is there a way in that reference syntax to specify a version?有没有办法在该参考语法中指定版本? And if not, is there a way to make NPM suppress reporting the package as outdated?如果没有,有没有办法让 NPM 禁止将包报告为过时?


Tested with Node.js v12.6.0 and NPM v6.9.0使用 Node.js v12.6.0 和 NPM v6.9.0 进行测试

The package.json documentation mentions in the Git URLs as Dependencies package.json 文档在Git URL 中作为依赖项提及

Git urls are of the form: Git 网址的格式为:

 <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]

<protocol> is one of git , git+ssh , git+http , git+https , or git+file . <protocol>gitgit+sshgit+httpgit+httpsgit+file

That could explain the " Wanted git " part of the error message.这可以解释错误消息的“ Wanted git ”部分。

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

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