npm install can't install dependincies from a github url in the intellij terminal

I have a package.json where one of the dependencies points to a url instead of a semver. You can see on line 87 of https://github.com/BitGo/BitGoJS/blob/master/package.json where that is. When I try to run `npm install`, I get:

 

/Users/user1/.nvm/versions/node/v6.12.3/bin/node /Users/user1/.nvm/versions/node/v6.12.3/lib/node_modules/npm/bin/npm-cli.js install --scripts-prepend-node-path=auto
npm ERR! git fetch -a origin (https://github.com/BitGo/bitcoinjs-lib.git) fatal: unable to access 'https://github.com/BitGo/bitcoinjs-lib.git/': Couldn't connect to server
npm ERR! Darwin 17.4.0
npm ERR! argv "/Users/zacleids/.nvm/versions/node/v6.12.3/bin/node" "/Users/zacleids/.nvm/versions/node/v6.12.3/lib/node_modules/npm/bin/npm-cli.js" "install" "--scripts-prepend-node-path=auto"
npm ERR! node v6.12.3
npm ERR! npm v3.10.10
npm ERR! code 128

npm ERR! Command failed: git fetch -a origin
npm ERR! fatal: unable to access 'https://github.com/BitGo/bitcoinjs-lib.git/': Couldn't connect to server
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/user1/dev/BitGoJS/npm-debug.log

Process finished with exit code 1

 

However, when I run `npm install` in the Mac osx terminal, it succeeds. I used to be able to run npm install in the Intellij built in terminal in the variouis 2017 versions. But after installing 2018.1, it no longer works.

11 comments
Comment actions Permalink

From the output it seems that you are not using the built-in terminal, looks like your are running Run 'npm install' from package.json right-click menu... Anyway, I can hardly imagine what can be causing Git connection failure when running npm through IDEA. Can you try running exacly the same command (/Users/user1/.nvm/versions/node/v6.12.3/bin/node /Users/user1/.nvm/versions/node/v6.12.3/lib/node_modules/npm/bin/npm-cli.js install --scripts-prepend-node-path=auto) in terminal? Also, does npm install work if your start IDEA from terminal?

0
Comment actions Permalink

I tried that command from terminal and it works, but in Intellij's terminal it fails:

User1-MacBook-Pro BitGoJS (master) $ /Users/user1/.nvm/versions/node/v6.12.3/bin/node /Users/user1/.nvm/versions/node/v6.12.3/lib/node_modules/npm/bin/npm-cli.js install --scripts-prepend-node-path=auto
npm ERR! git fetch -a origin (https://github.com/BitGo/bitcoinjs-lib.git) fatal: unable to access 'https://github.com/BitGo/bitcoinjs-lib.git/': Couldn't connect to server
npm ERR! Darwin 17.4.0
npm ERR! argv "/Users/user1/.nvm/versions/node/v6.12.3/bin/node" "/Users/user1/.nvm/versions/node/v6.12.3/lib/node_modules/npm/bin/npm-cli.js" "install" "--scripts-prepend-node-path=auto"
npm ERR! node v6.12.3
npm ERR! npm v3.10.10
npm ERR! code 128

npm ERR! Command failed: git fetch -a origin
npm ERR! fatal: unable to access 'https://github.com/BitGo/bitcoinjs-lib.git/': Couldn't connect to server
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/user1/dev/BitGoJS/npm-debug.log
User1-MacBook-Pro BitGoJS (master) $

 

Opening Intellij from terminal with the command 'open IntelliJ\ IDEA.app/' did not change anything. You are correct that the original output i pasted was from the right click menu, npm install fails from both.

0
Comment actions Permalink

I made a project with only one dependency to replicate to see if this behavior affects other projects. that repository is https://github.com/zacleids/installtest, and still occurs with one very simple dependency pointing to a github repository. Hopefully this can be replicated and fixed.

0
Comment actions Permalink

works fine for me using both the menu and built-in terminal:

0
Comment actions Permalink

what are npm config get registry results when running in built-in and system terminals?

0
Comment actions Permalink

Weird... Can you check if the issue persist when you start WebStorm from terminal? Just to make sure that there are no environment variables preventing you from fetching the repo...

0
Comment actions Permalink

BTW, what is the result of running git clone https://github.com/stevemao/left-pad.git in built-in terminal?

0
Comment actions Permalink

Just in case it matters, Im using Intellij IDEA and not webstorm, but I don't know their core differences. I ran 'open IntelliJ\ IDEA.app/' and got the same error when running npm install. 

 

I just tried to clone left-pad, and got:

Zacs-MacBook-Pro installTest (master) $ git clone https://github.com/stevemao/left-pad.git
Cloning into 'left-pad'...
fatal: unable to access 'https://github.com/stevemao/left-pad.git/': Couldn't connect to server

 

It seems my git clone is broken in the Intellij Terminal. But I can still run git pull and git push in the Intellij Terminal. I also ran the clone from the Mac OSx terminal and it worked.

0
Comment actions Permalink

Hello, I have solved the problem, it was unrelated to IntelliJ and was a network filter blocking IntelliJ from executing https-git commands. I am sorry to have wasted your time, thank you for trying to help me solve my problem.

1
Comment actions Permalink

I see, thanks for clearing it up:)

0

Please sign in to leave a comment.