Installing Node using Brew fails - node.js

I ran brew install node it said Warning: The post-install step did not complete successfully You can try again using `brew postinstall node. I then ran brew postinstall --debug node and then it failed with:
An exception occurred within a child process:
Errno::EACCES: Permission denied # rb_sysopen - /usr/local/lib/node
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1386:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1386:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1386:in `block in copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1385:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1385:in `copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1353:in `copy'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:478:in `block in copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1484:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1487:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1486:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1486:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:475:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:453:in `block in cp_r'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1557:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1571:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1555:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:452:in `cp_r'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node.rb:62:in `post_install'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1036:in `block (2 levels) in run_post_install'
/usr/local/Homebrew/Library/Homebrew/formula.rb:891:in `with_logging'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1035:in `block in run_post_install'
/usr/local/Homebrew/Library/Homebrew/utils.rb:474:in `with_env'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1025:in `run_post_install'
/usr/local/Homebrew/Library/Homebrew/postinstall.rb:21:in `<main>'
When I run brew doctor it responds with:
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/node/v8-testing.h
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
python
python#3.8
and when I run brew config it responds with:
HOMEBREW_VERSION: 2.4.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: f455fe28a7a47b51af090b308e95535d6cf0a423
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 3e559ee9667cd55a21aa4bfaa50074cea090b4fb
Core tap last commit: 26 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_MAKE_JOBS: 4
CPU: quad-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1103
Git: 2.24.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 14.0.1, 11.0.7, 1.8.0_252
macOS: 10.15.5-x86_64
CLT: 1103.0.32.59
Xcode: 11.5
I an running Mac OS Catalina. I tried uninstalling node and reinstalling node. I tried to give the necessary permission to brew, that didn't help either.
Can anyone help me?

Can you try brew reinstall node?
If that does not work, can you attach the brew doctor or brew config for debugging? Good luck!

Related

Can't Install Node 12.8

I have been trying to install node.js on my Mac to use React Native. I tried many different times to install and reinstall node but I'd get a lot of errors.
I have tried installing on a fresh hard drive and I still can't seem to get it to work.
What I would try:
bash-3.2$ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-12.8.0.mojave.bottle.t
Already downloaded: /Users/malqadi/Library/Caches/Homebrew/downloads/8ea6192c6101b64b58b3ff8bf0cab0b89eb67851ec11f5c95edda2fffcbdbfb0--node-12.8.0.mojave.bottle.tar.gz
==> Pouring node-12.8.0.mojave.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/systemtap/tapset/node.stp
Target /usr/local/share/systemtap/tapset/node.stp
already exists. You may want to remove it:
rm '/usr/local/share/systemtap/tapset/node.stp'
To force the link and overwrite all conflicting files:
brew link --overwrite node
To list all files that would be deleted:
brew link --overwrite --dry-run node
Possible conflicting files are:
/usr/local/share/systemtap/tapset/node.stp
/usr/local/lib/dtrace/node.d
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall node`
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/node/12.8.0: 4,629 files, 53.1MB
I do what it recommends, but its the same:
bash-3.2$ brew postinstall node
==> Postinstalling node
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall node`
So I try brew doctor:
bash-3.2$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
node
How would I get this to work?
Try removing the npm module with this command:
rm '/usr/local/share/systemtap/tapset/node.stp'
before linking node with this command:
brew link node

Stuck installing node with Homebrew in MacOS: fork.rb:49:in `write': Broken pipe (Errno::EPIPE)

I am consistently getting the error below during the postinstall step when installing node in macOS Sierra.
$ brew postinstall node --verbose
==> Postinstalling node
/usr/bin/sandbox-exec -f /private/tmp/homebrew20180915-55177-tjsmxe.sb nice /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/x86_64-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/universal-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/universal-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/x86_64-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/universal-darwin9.0:/usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/postinstall.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node.rb --verbose
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE)
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `rescue in block (3 levels) in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in `block (3 levels) in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `block (2 levels) in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `open'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `block in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in `safe_fork'
from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:886:in `post_install'
from /usr/local/Homebrew/Library/Homebrew/cmd/postinstall.rb:14:in `block in postinstall'
from /usr/local/Homebrew/Library/Homebrew/cmd/postinstall.rb:11:in `each'
from /usr/local/Homebrew/Library/Homebrew/cmd/postinstall.rb:11:in `postinstall'
from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall node`
I have this version of Homebrew:
Homebrew 1.7.4
Homebrew/homebrew-core (git revision a216b; last commit 2018-09-15)
I uninstalled node but that didn't help.
Any suggestions?
I ran into the same issue today. It turned out to be an issue with permissions on /usr/local.
To change ownership of /usr/local:
sudo chown -R $(whoami) $(brew --prefix)/*
Remove broken node install: brew uninstall node
Re-install node: brew install node

Jekyll installation, wrong number of arguments

I am running Fedora 28. Having trouble installing Jekyll. I have all the dependencies mentioned on their installation page.
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
gem -v
2.5.2
bundle -v
Bundler version 1.16.1
When I try to install Jekyll, I am getting this -
gem install jekyll
ERROR: While executing gem ... (ArgumentError)
wrong number of arguments (given 1, expected 0)
Running as root doesn't help either. When I run backtrace,
gem install jekyll --backtrace
ERROR: While executing gem ... (ArgumentError)
wrong number of arguments (given 1, expected 0)
/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:47:in `require'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:162:in `initialize'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:104:in `new'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:104:in `at'
/usr/local/share/ruby/site_ruby/rubygems/resolver/specification.rb:93:in `install'
/usr/local/share/ruby/site_ruby/rubygems/request_set.rb:166:in `block in install'
/usr/local/share/ruby/site_ruby/rubygems/request_set.rb:156:in `each'
/usr/local/share/ruby/site_ruby/rubygems/request_set.rb:156:in `install'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:250:in `install_gem'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:300:in `block in install_gems'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:296:in `each'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:296:in `install_gems'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:203:in `execute'
/usr/local/share/ruby/site_ruby/rubygems/command.rb:308:in `invoke_with_build_args'
/usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:169:in `process_args'
/usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:139:in `run'
/usr/local/share/ruby/site_ruby/rubygems/gem_runner.rb:55:in `run'
/usr/bin/gem:21:in `<main>'
I guess the ruby version was the problem. Once I installed ruby 2.4 using https://rvm.io/ installation was successful

Brew install node --without-npm fails

Following John Papa's post on 'How to use npm global without sudo on OSX' and I am running
brew install node --without-npm
I get this info/error(s):
/usr/local > brew install node --without-npm
==> Downloading https://nodejs.org/dist/v5.10.1/node-v5.10.1.tar.xz
Already downloaded: /Library/Caches/Homebrew/node-5.10.1.tar.xz
==> Downloading https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz
Already downloaded: /Library/Caches/Homebrew/node--icu4c-56.1.tgz
==> ./configure --prefix=/usr/local/Cellar/node/5.10.1 --without-npm --with-intl
==> make install
Last 15 lines from /Users/justin/Library/Logs/Homebrew/node/02.make:
#include <limits>
^
In file included from ../deps/gtest/src/gtest-death-test.cc:34:
In file included from ../deps/gtest/include/gtest/gtest-death-test.h:41:
In file included from ../deps/gtest/include/gtest/internal/gtest-death-test-internal.h:40:
In file included from ../deps/gtest/include/gtest/internal/gtest-internal.h:40:
../deps/gtest/include/gtest/internal/gtest-port.h:259:10: fatal error: 'ctype.h' file not found
#include <ctype.h> // for isspace, etc
^
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o] Error 1
make: *** [node] Error 2
Following Homebrew's troubleshooting instructions, I ran brew update twice and brew doctor -- but still no luck. I'm not familiar with homebrew and haven't messed with this stuff in a while. Any ideas what these errors mean?
It seems you did not install command line developer tools. Before installing Node with Homebrew, try executing this command in your Terminal:
xcode-select --install
If it is installed successfully this message will be shown:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
After the installation, run the brew command again.
The ctype.h file should be somewhere like /usr/include/ctype.h.

foreman db import fails

I have installed foreman on centos 6, using the yum repo
[root#server roor]# cat /etc/yum.repos.d/foreman.repo
[foreman]
name=Foreman Repo
baseurl=http://yum.theforeman.org/releases/latest/el6/x86_64/
gpgcheck=0
enabled=1
and configured database.yml as
production:
adapter: mysql
database: foreman
username: foreman
password: xxxxxx
encoding: utf8
however while building the tables, gives this error, any ideas?
[root#server foreman]# sudo RAILS_ENV=production rake db:migrate
(in /usr/share/foreman)
rake aborted!
no such file to load -- rails/all
/usr/share/foreman/Rakefile:1
(See full trace by running task with --trace)
[root#serverforeman]#
UPDATED:
fixed using
[root#server foreman]# cat /opt/rh/ruby193/enable
export PATH=/opt/rh/ruby193/root/usr/bin:$PATH
export LD_LIBRARY_PATH=/opt/rh/ruby193/root/usr/lib64:$LD_LIBRARY_PATH
export MANPATH=/opt/rh/ruby193/root/usr/share/man:$MANPATH
but now its stuck on....
[root#server foreman]# RAILS_ENV=production rake db:migrate --trace
rake aborted!
undefined method `active_record' for #<Rails::Application::Configuration:0x00000003ad8358>
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configuration.rb:85:in `method_missing'
/usr/share/foreman/config/application.rb:57:in `<class:Application>'
/usr/share/foreman/config/application.rb:37:in `<module:Foreman>'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in `load'
/opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in `load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:501:in `raw_load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:82:in `block in load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:81:in `load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:65:in `block in run'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run'
/opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'
FIXED:
currently foreman will have problems if there are multiple version of activerecord/ mysql installed, and one should use the gems supplied with the foreman installation.
so these were the steps to remove the unnecessary gems
scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql
currently foreman will have problems if there are multiple version of activerecord/ mysql installed, and one should use the gems supplied with the foreman installation.
so these were the steps to remove the unnecessary gems
scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql

Resources