简体   繁体   English

NPM安装将不会使用我提供的git url

[英]NPM Install won't use my provided git url

I have a dev dependancy in my package.json file that points to a local gitlab repository. 我的package.json文件中有一个开发依存关系,它指向本地gitlab存储库。

"devDependencies": {
    "browser-sync": "^1.2.1",
    "event-stream": "^3.1.5",
...
    "mymodule": "git+http://my.gitlab.url/team/repo.git",
...
    "run-sequence": "^0.3.6"
  }

This does not work. 这是行不通的。 When I look in the npm-debug.log file, it seems that instead of cloning the repo from gitlab, its trying to find it in the npm repository: 当我查看npm-debug.log文件时,似乎不是从gitlab克隆存储库,而是尝试在npm存储库中找到它:

26 http GET https://registry.npmjs.org/mymodule
27 http 404 https://registry.npmjs.org/mymodule

Then of course further down in the file: 然后当然在文件中进一步:

32 error 404 404 Not Found: mymodule
32 error 404
32 error 404 'mymodule' is not in the npm registry.
32 error 404 You should bug the author to publish it

If i run git clone to get the contents of the repo it works. 如果我运行git clone以获取回购的内容,则可以正常工作。 If I run "npm install" followed by the path in the package.json file it works. 如果我运行“ npm install”,然后运行package.json文件中的路径,则它可以正常工作。 But it does not work when I run a simple "npm install". 但是,当我运行简单的“ npm install”时,它不起作用。

Can anyone explain why? 谁能解释为什么?

So..... why does it not honour the gitlab path in my package.json when I run "npm install"? 所以.....为什么当我运行“ npm install”时,它不遵守我的package.json中的gitlab路径?

The error messages are a red herring. 错误消息是红色鲱鱼。 This was caused by app level inspection (and blocking) on our firewall. 这是由防火墙上的应用程序级别检查(和阻止)引起的。 Answer here as a "something to check with your security guys" for the next person. 在此作为对下一个人的“与您的安全人员联系的检查”。

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

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