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

fis3 install 出现404 #56

Closed
codering opened this issue Sep 11, 2015 · 2 comments
Closed

fis3 install 出现404 #56

codering opened this issue Sep 11, 2015 · 2 comments

Comments

@codering
Copy link
Contributor

$ fis3 install

 [INFO] Currently running fis3 (C:\work\nodejs\npm-global\node_modules\fis3\)

 [ERROR] Error: <!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <link href="/static.css" media="screen" rel="stylesheet" type="text/css" />
</head>

<body>
  <h1>404</h1>
  <h3>The page you were looking for doesn't exist.</h3>
  <hr/>
  <p>You may have mistyped the address or the page may have moved.</p>
</body>
</html>
 while loading gitlab:http://git.anything.com/just7039/jquery-autocomplete

我是将 https://github.com/fis-components/jquery-autocomplete 导入到公司内网的gitlab, http://git.anything.com/just7039/jquery-autocomplete 在浏览器是可访问的。

fis-conf.js

fis.config.set('component.gitlab', {
    author: 'just7039',
    domain: 'http://git.anything.com/',
    token: 'evv1PgwcrL6qN8ktysRw'
});

component.json

{
    "protocol": "gitlab",
    "dependencies": [
        "jquery-autocomplete"
    ]
}
@codering
Copy link
Contributor Author

@2betop 找到问题了,公司用的gitlab版本太低了(5.2.1).
我自己修改了几处代码:

// return request(self.domain + 'api/v3/projects/' + projectId + '/repository/blobs/'+ (self.tagsmap[self.version] || self.version) + '?filepath=component.json', options.token);

// 针对老版本的gitlab api不一样
return request(self.domain + 'api/v3/projects/' + projectId + '/repository/commits/'+ (self.tagsmap[self.version] || self.version) + '/blob?filepath=component.json', options.token);
// self.config = body;

// 针对老版本的gitlab, body是字符串,不是json对象
self.config = self.noramlizeConfig(JSON.parse(body));
if (!self.config || !self.config.name) {
    //this.postfix = '/repository/archive.tar.gz?ref=';

    // 老版本 api不一样,并且要带上 private_token
    this.postfix = '/repository/archive?private_token=xxxxxxxxxx&ref=';

这么老的版本,估计不会再考虑兼容了吧?

@2betop
Copy link
Contributor

2betop commented Jan 11, 2016

赞,感谢在此贴出解决方案。

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

No branches or pull requests

2 participants