Cannot Install Node using NVM on my mac os mavericks - node.js

When I run the command:
nvm install 0.10
I get this error:
tar: Error opening archive: Failed to open '-xzf'
Binary download failed, trying source.
######################################################################## 100.0%
tar: Error opening archive: Failed to open '-xzf'
nvm: install v0.10.26 failed!
What should I do to correct this?

Did you find your answer?
If not, you can try:
$ nvm install -s 0.10
The -s flag is used to compile from source and it worked for me.
I also wrote a blog post about that, if it can be helpful :)
Setting up nvm, node & npm on Mavericks
Hope it helps! :)

Related

Can't run node or npm, getting the message "zsh: killed" or "Killed: 9" when running on bash

Not sure if related, but over the weekend I upgraded my OS to Big Sur version 11.1 and then when I began working one thing went wrong after another and now I can't use node or npm at all. I get the following message in zsh:
% node -v
zsh: killed node -v
And the following on bash
node -v
Killed: 9
I've tried to install different versions of node through n, which makes no difference.
How it got this way?
Prior to this issue (after my OS upgrade), I couldn't run npm install, and would get the following message:
Maximum call stack size exceeded
This seems to have been reported on this thread, but as of writing this there are no replies.
As the OP on that thread says, I tried installing npm v7, which initially did solve my problem with the npm install, however caused other issues on the project.
I then decided to use n to install the latest version of node and this caused the errors I have above.
Does anyone know what's going on and how to fix it?
Edit: I was forced to uninstall and reinstall node to be able to go back to work, which did solve it but I am leaving this thread up in case there is a better solution.
TLDR:
brew uninstall git
brew update
brew reinstall pcre2 gettext
brew install git
brew reinstall node
I'm sure there's a more surgical solution (e.g., maybe you don't need brew reinstall pcre2 gettext), but this ^^ worked for me. Below is the path I took:
Skimming some google results, seemed it was at least partly due to the new M1 silicon and the minor MacOS update to 11.2.2. Tried to brew update and got:
Error: Failure while executing; `git config --replace-all homebrew.analyticsmessage true` was terminated by uncaught signal KILL.
Which led me to this: https://github.com/Homebrew/brew/issues/10275#issuecomment-757351887. After doing these uninstall, reinstall, installs, I finished with a brew reinstall node and voilà! Didn't need to uninstall node and install from scratch:
an#As-Air ~ % node -v
v15.11.0
TL;DR
The solution is to reinstall node and all its dependencies. Luckily, Homebrew offers a one-liner all-in-one solution:
brew reinstall $(brew deps node) node
Why?
I had followed #albielin and #Mariusz' solutions without success. I didn't yet want the #bgh's nuclear option to reinstall Homebrew with all its packages.
It seems in my case, the issue wasn't coming from those specific dependencies (pcre2 gettext openssl icu4c), but rather another one. No need to worry about git. But do reinstall all dependencies to be sure and avoid an endless trial-and-error with every one of them.
Had the same issue. Tried #albielin approach but it still didn't work for me. Ive took a look in the console and saw issues with openssl and icu4c when executing node --version and reinstalled both. Now it works.
So in addition to #albielin commands I did:
brew reinstall openssl
brew reinstall icu4c
I had the same issue. The answers above didn't work for me. Looking at the console while running node --version I found the error load code signature error 2 for file "node"
Reinstalling Homebrew as detailed in this Stack Overflow answer did it for me:
Run the official uninstall script: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Clean up: sudo rm -rf /opt/homebrew
Fresh install: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install node: brew install node
The node post-install process ran into a few issues due to symlinks that could not be overwritten. The advice given in this article helped me resolve this; a few sudo chown ... and brew link --overwrite node commands later node was successfully installed!

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib in VSCode Terminal

For my case, i only get the error when opening accessing terminal (zsh) via VS Code.
Upon opening VS Code terminal OR running node command, i get this error:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
[1] 4506 abort node
However, it runs fine when running via iTerm. Tried running brew update and brew upgrade and a few other recommended answers.
Anything am i missing?
Piggybacking off Jason's answer, another option is to just run
brew upgrade node
Found the answer here
Run this
brew uninstall node icu4c
brew install node
You might follow these steps.
> which node
/usr/local/bin/node
> rm /usr/local/bin/node
> brew unlink node
> brew link --overwrite node
This should solve the problem.
A brew reinstall icu4c fixed the problem on macOS 10.15.6.
It also helps to watch your logs when starting a broken package (node, pg, etc. – for pg it's tail -f /usr/local/var/log/postgresql#11.log – not the server log).
I had to reinstall VSCode using the apple silicon download link here. If I installed the from the command line it kept using the old /usr/bin folders instead of the new M1 brew folder /opt/homebrew

nodejs: installing stable (0.12.7) with nvm fails

$ nvm install stable
######################################################################## 100.0%
mv: cannot move ‘/home/me/.nvm/bin/node-v0.12.7-linux-x64’ to ‘/home/me/.nvm/versions/v0.12.7’: No such file or directory
Binary download failed, trying source.
######################################################################## 100.0%
File "./configure", line 362
'''
^
SyntaxError: Missing parentheses in call to 'print'
nvm: install v0.12.7 failed!
This is on a manjaro linux box, running nvm version 0.20.0.
I tried directly with
nvm install v0.12.7 or
nvm install 0.12.7 and also
nvm install 0.12.6
all reported the same error.
I also tried re-running the nvm installation script, but it told me it already had nvm installed. I am a bit reluctant to delete .nvm and re-install it (for no obvious reason ;) )
I don't know what causes the first problem:
mv: cannot move ‘/home/me/.nvm/bin/node-v0.12.7-linux-x64’ to ‘/home/me/.nvm/versions/v0.12.7’: No such file or directory
Binary download failed, trying source.
But then it tries from source and tries to compile, using python. The error :
SyntaxError: Missing parentheses in call to 'print'
is from python - python3. By temporarily changin the symlink in manjaro from
/usr/bin/python -> python3 to
/usr/bin/python -> python2
I seam to have "solved" the issue....

node-0.12.7_1 already installed, it's just not linked

So, lately i checked my npm version and got this error message:
Yogies-MacBook-Pro:bin yogieputra$ node --version
v0.12.7
Yogies-MacBook-Pro:bin yogieputra$ npm --version
-bash: /usr/local/bin/npm: No such file or directory
Yogies-MacBook-Pro:bin yogieputra$ brew install npm
Warning: node-0.12.7_1 already installed, it's just not linked
Anyone know how to fix this issue?
Run brew link nodeor brew doctor.
You could need sudo so sudo brew link node
To link already installed node, run following command:
brew link homebrew/versions/node012
For further explanation, you can go through this.

pidora nodejs is resulting an error

I'm getting this below error when trying to use nodes on my PI with fedora variant of OS.
ERROR: Binary compiled with -mfloat-abi=hard but without -DUSE_EABI_HARDFLOAT
nodeJS version --> v0.10.25, installed via "yum install nodejs"
nodeJS version --> v0.11.9, downloaded from "http://nodejs.org/dist/v0.11.9/" also gives the same error.
any clue on how i can get pass this?
I was able to use the downloaded copy of "node-v0.10.19-linux-arm-pi" with out an error.
Thanks,
-Vikas.
I had the same issue, and I couldn't compile npm at all, so I did what you suggested:
wget http://nodejs.org/dist/v0.10.5/node-v0.10.5-linux-arm-pi.tar.gz
cd /usr/local
sudo tar xzvf ~/node-v0.10.5-linux-arm-pi.tar.gz --strip=1
echo "export PATH=$PATH:/usr/local/bin/node" > ~/.bash_aliases
bash
node -v
v0.10.5
npm -v
1.2.18
Hope this would be useful for somebody else ;-)

Resources