Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(npm): ( issue #21 ) Fixed NPM repo package.json file URL #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

medz
Copy link

@medz medz commented Jul 9, 2018

Latest NPM repo delete master branch!

Now the latest location of the file is in the latest branch!

See 👉 https://github.com/npm/npm/branches/all

fix #21

@medz
Copy link
Author

medz commented Jul 9, 2018

@Kenshin

@medz
Copy link
Author

medz commented Jul 9, 2018

@Kenshin 我推荐一种方式!不要去仓库里面拿 package.json 这个文件,因为你要考虑,可能 npm 会更改分支名称!这个问题就是因为 npm 没有 master 分支了,而是 latest 分支。

那么,不去仓库拿,那去哪里拿呢?很简单:

https://api.github.com/repos/npm/npm/releases/latest

这个是 GitHub api,可以拿到最新稳定版本的信息

其次,你如果有 NPM 版本切换功能,你可以使用 https://api.github.com/repos/npm/npm/releases 拿到所有历史版本,这样不会依赖 npm 仓库结构。历史版本运行也会比较良好。

@Kenshin
Copy link
Owner

Kenshin commented Jul 10, 2018

谢谢 pr,我近期在出差,而且暂时并没有 Golang 环境,等我回去后,会 Fixed 掉这个问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm update failed
2 participants