Code Monkey home page Code Monkey logo

Comments (11)

rkaw92 avatar rkaw92 commented on June 2, 2024

Hm, interesting. Does the HTTPS protocol work for you from that host to any other host on the Web? I just tested with npm v5.3.0 and it correctly downloads the dependency without requiring ssh access to GitHub.

Supposedly, npm tries HTTPS first and then falls back to SSH if that fails for whatever reason. Maybe HTTPS is simply failing for you.

from pm2-zabbix.

 avatar commented on June 2, 2024

Yes, HTTPS work fine for that host. You can try reproduce with issue by using clear VM (ubuntu/centos) with latest node.

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 2, 2024

Just checked with Docker image ubuntu, with latest Node. It seems to work fine and does not try to use ssh. Just to make sure, could you test whether your git can clone https repositories?
git clone https://github.com/greatcare/node-zabbix-sender.git

from pm2-zabbix.

Warfunck avatar Warfunck commented on June 2, 2024

Hi, i have the same problem:
npm install -g --verbose pm2-zabbix
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node',
npm verb cli '/usr/bin/npm',
npm verb cli 'install',
npm verb cli '-g',
npm verb cli '--verbose',
npm verb cli 'pm2-zabbix' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 7fc7a08e9da1a064
npm http fetch GET 304 https://registry.npmjs.org/pm2-zabbix 142ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/bunyan 75ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pidusage 128ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minimist 132ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/when 131ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pm2 137ms (from cache)
npm verb stack Error: exited with error code: 128
npm verb stack at ChildProcess.onexit (/usr/lib/node_modules/npm/node_modules/mississippi/node_modules/end-of-stream/index.js:39:36)
npm verb stack at emitTwo (events.js:106:13)
npm verb stack at ChildProcess.emit (events.js:191:7)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
npm verb cwd /root
npm verb Linux 4.9.0-4-amd64
npm verb argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "--verbose" "pm2-zabbix"
npm verb node v6.12.2
npm verb npm v5.6.0
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/greatcare/node-zabbix-sender.git
npm ERR!
npm ERR! fatal: failed to stat '.': Permission denied
npm ERR!
npm ERR! exited with error code: 128
npm verb exit [ 1, true ]

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-01-11T07_07_00_828Z-debug.log

Using debian 9.3
Linux name 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux

from pm2-zabbix.

Warfunck avatar Warfunck commented on June 2, 2024

git clone https://github.com/greatcare/node-zabbix-sender.git
Cloning into 'node-zabbix-sender'...
remote: Counting objects: 206, done.
remote: Total 206 (delta 0), reused 0 (delta 0), pack-reused 206
Receiving objects: 100% (206/206), 1.17 MiB | 0 bytes/s, done.
Resolving deltas: 100% (89/89), done.

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 2, 2024

@Warfunck I see. This seems to be an oddity in npm's resolving of modules tagged as github:.
I have not been able to reproduce the above issue yet - suspecting something is on the local npm's end. Could you try to replicate exactly what npm is doing?

npm install -g github:greatcare/node-zabbix-sender#v0.3.0

The above command does work for me on [email protected] and also on other hosts with various npm versions. However, one difference I've noticed is this invocation:
/usr/bin/git ls-remote -h -t ssh://[email protected]/greatcare/node-zabbix-sender.git

On my test machine, npm produces this instead:
/usr/bin/git ls-remote -h -t git://github.com/greatcare/node-zabbix-sender.git

Surprisingly, both appear to work, although one of them (the latter) is clearly not using SSH.

Let's see what installing node-zabbix-sender (first command above) does for you, and if that fails, check where git ls-remote ... is going wrong.

from pm2-zabbix.

Warfunck avatar Warfunck commented on June 2, 2024

Thank you for answering my question. That's what i got:

cat /root/.npm/_logs/2018-01-11T11_26_48_298Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli '--verbose',
1 verbose cli 'github:greatcare/node-zabbix-sender#v0.3.0' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 7da3c10c6cfabfd4
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for github:greatcare/node-zabbix-sender#v0.3.0 Error while executing:
7 silly fetchPackageMetaData /usr/bin/git ls-remote -h -t ssh://[email protected]/greatcare/node-zabbix-sender.git
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData fatal: failed to stat '.': Permission denied
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData exited with error code: 128
8 verbose stack Error: exited with error code: 128
8 verbose stack at ChildProcess.onexit (/usr/lib/node_modules/npm/node_modules/mississippi/node_modules/end-of-stream/index.js:39:36)
8 verbose stack at emitTwo (events.js:106:13)
8 verbose stack at ChildProcess.emit (events.js:191:7)
8 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
9 verbose cwd /root
10 verbose Linux 4.9.0-4-amd64
11 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "--verbose" "github:greatcare/node-zabbix-sender#v0.3.0"
12 verbose node v6.12.2
13 verbose npm v5.6.0
14 error Error while executing:
14 error /usr/bin/git ls-remote -h -t ssh://[email protected]/greatcare/node-zabbix-sender.git
14 error
14 error fatal: failed to stat '.': Permission denied
14 error
14 error exited with error code: 128
15 verbose exit [ 1, true ]

AND

/usr/bin/git ls-remote -h -t ssh://[email protected]/greatcare/node-zabbix-sender.git
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 2, 2024

So apparently npm is using SSH, instead of HTTP, for cloning the git repository, and failing for lack of public key (which is understandable). I have not yet been able to reproduce this behavior of npm myself, though - must investigate what causes it to choose one protocol (URL scheme) or the other. Do you perchance have a customized npm or git configuration?

from pm2-zabbix.

Warfunck avatar Warfunck commented on June 2, 2024

We downgraded npm, installed the module, then updated it back. Now it s ok, thx a lot.

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 2, 2024

Might be related: npm/npm#19168

from pm2-zabbix.

waeller avatar waeller commented on June 2, 2024

I have the same problem since we upgraded from node 6/npm 3 to node 8.9/npm 5.6, when doing "sudo npm -g install pm2-zabbix". However, "npm install pm2-zabbix" works.

from pm2-zabbix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.