简体   繁体   中英

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.

"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:

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. If I run "npm install" followed by the path in the package.json file it works. But it does not work when I run a simple "npm install".

Can anyone explain why?

So..... why does it not honour the gitlab path in my package.json when I run "npm install"?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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