nvm install fails on curl request - node.js

When running:
nvm install iojs-v2
I get the following error:
######################################################################## 100.0%
curl: (7) Failed to connect to localhost port 80: Connection refused
grep: /Volumes/Macintosh HD/Users/ev_blurbs/.nvm/bin/iojs-v2.5.0-darwin-x64/iojs-v2.5.0-darwin-x64.tar.gz: No such file or directory
Binary download failed, trying source.
Installing iojs from source is not currently supported
I'm not sure why the curl command is failing. Any help would be much appreciated. Thanks!
UPDATE:
I commented out all the localhost records in my /etc/host file. Now running nvm install iojs-v2 returns:
######################################################################## 100.0%
curl: (47) Maximum (50) redirects followed
grep: /Volumes/Macintosh HD/Users/ev_blurbs/.nvm/bin/iojs-v2.5.0-darwin-x64/iojs-v2.5.0-darwin-x64.tar.gz: No such file or directory
Binary download failed, trying source.
Installing iojs from source is not currently supported
UPDATE 2:
I'm using OSX 10.10.5. IOJS is trying to use Darwin. I believe that's correct, but wanted to list this.

(nvm maintainer here)
Specifically, curl: (7) Failed to connect to localhost port 80: Connection refused is the reason it's failing. Have you perhaps set a custom curl proxy?
Please try updating to the latest version of nvm; if it still doesn't work, please file an issue on the project repo and fill out the issue template.

Related

Mac cannot access port 22

In conclusion, I cannot connect to port 22. To allow connection of port 22, I need to use ufw to set it up, but I was unable to do so on my machine.
I was trying to connect a server by running the command
ssh username#xx.xxx.xxx.xx
but I got the following errors
ssh: connect to host username#xx.xxx.xxx.xx port 22: Operation timed out
I googled it and figured out that the problem was related to port 22 connection, therefore I tried the following command as recommended.
sudo ufw allow 22/tcp
but I it seems like I need to install ufw first. I run the following command as recommended.
sudo apt-get install ufw
but It seems like I need to install apt-get. I tried to install it, but this post said Mac only use Brew. https://stackoverflow.com/questions/5231160/sudo-apt-get-command-not-found. I tried to use brew but this is what I got.
brew install ufw
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "ufw".
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get its complete history, run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
How do I fix this issue? Thank you.
Eventually I figure out that the problem is related to my VPN. I cannot connect to the port using my current VPN. However, I could connect to the port using another computer because it uses a correct VPN.

NVM can not install nodejs on ubuntu 18.04

I Tried to install nodejs using nvm on ubuntu 18.04. But everytime it's throwing following error stack
pasindu#pasindu-HP-EliteBook-850-G7-Notebook-PC:~$ nvm install 0.10.35
Downloading and installing node v0.10.35...
Downloading https://nodejs.org/dist/v0.10.35/node-v0.10.35-linux-x64.tar.gz...
Warning: Failed to create the file
Warning: /home/pasindu/.nvm/.cache/bin/node-v0.10.35-linux-x64/node-v0.10.35-li
Warning: nux-x64.tar.gz: Permission denied
curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v0.10.35/node-v0.10.35-linux-x64.tar.gz failed, trying source.
grep: /home/pasindu/.nvm/.cache/bin/node-v0.10.35-linux-x64/node-v0.10.35-linux-x64.tar.gz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 12 CPU core(s)
Running with 11 threads to speed up the build
Downloading https://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz...
Warning: Failed to create the file
Warning: /home/pasindu/.nvm/.cache/src/node-v0.10.35/node-v0.10.35.tar.gz:
Warning: Permission denied
curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz failed, trying source.
grep: /home/pasindu/.nvm/.cache/src/node-v0.10.35/node-v0.10.35.tar.gz: No such file or directory
Provided file to checksum does not exist.
It may be the problem of snap curl, see here, cos I installed curl with snap at first and always encounter this problem, then I removed curl with sudo snap remove curl and reinstall it with sudo apt install curl, my current curl version is 7.68.0. then solved it.
I had to clear the cache:
nvm cache clear.
I've got the error after I tried to install a version of Node, which I've tried to install already, however the installation processs failed at the first time due disconnecting from the internet.

Unable to install NVM on my Mac. Keeps getting (7) Couldn't connect to server

As the title states, I can't seem to install NVM on my mac. I run this command:
curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash
but I get this
0curl: (7) Couldn't connect to server
Any ideas guys? Would be greatly appreciated!

node version manager: curl: (56) GnuTLS recv error (-54): Error in the pull function

This is the output i am getting while running command nvm install 4.6.0 in my ubuntu 16.04.
############################################################### 88.0%
curl: (56) GnuTLS recv error (-54): Error in the pull function.
Binary download from https://nodejs.org/dist/v4.6.0/node-v4.6.0-linux-x64.tar.xz failed, trying source.
grep: /home/swap/.nvm/.cache/bin/node-v4.6.0-linux-x64/node-v4.6.0-linux-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
####
I also experienced this issue and i believe it must be an issue with some GNU or curl
The way i was able to install nodejs was using node version manager
Step1
Run either:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
Use either wget or curl
step2
close current terminal and open another
nvm ls //should show if you have nodejs previous versions if none itll indicate
Step3:
Install latest version of nodejs by today its version 8
nvm install v8.6.0
check the latest version and replace the numbers
Now nodejs should be installed
node -v
npm -v

Can't install node with nodebrew

I've installed nodebrew with my homebrew and attempted to install the stable version of node. I'm using Mac OSX El Capitan version 10.11.1.
$ nodebrew install-binary stable
However, I'm getting the following error:
fetch: http://nodejs.org/dist/v5.1.1/node-v5.1.1-darwin-x64.tar.gz
Warning: Failed to create the file
Warning: /usr/local/Cellar/nodebrew/0.9.2/bin/nodebrew/src/v5.1.1/node- v5.1.1-d
Warning: arwin-x64.tar.gz: Not a directory
curl: (23) Failed writing body (0 != 987)
download faild: http://nodejs.org/dist/v5.1.1/node-v5.1.1-darwin-x64.tar.gz
I've tried searching for info about the same problem but no luck.
How can I fix it?
It is the permissions problem. so failed to create directory.
mkdir -p ~/.nodebrew/src

Resources