How to update homebrew in preparation for installing node/npm on macOS Mojave - node.js

I attempted to install node.js/npm onto a macbook running Mojave 10.14.5 so that I can do local development of a web app. From internet research my understanding is the first step is updating homebrew in preparation for installation but I got the error "Error: /usr/local must be writable!" when I ran:
brew update
I searched the internet and other people appeared to have the command below fix the problem, but for me that didn't work and I still got the error.
sudo chown -R $(whoami) $(brew --prefix)/*
Can anyone offer any advice as to what I can do so that I can update brew and install node.js/npm? Is the brew update required or should I just skip that step?
Below is the output from brew --prefix that may help...
MacBook-Pro:usr dannyboy$ ls -l $(brew --prefix)
total 215896
-rw-r--r-- 1 dannyboy admin 3161 May 23 2016 CODEOFCONDUCT.md
drwxr-xr-x 5 dannyboy admin 160 Nov 4 2018 Cellar
-rw-r--r-- 1 dannyboy admin 1241 Jan 13 2016 LICENSE.txt
drwxr-xr-x 11 dannyboy admin 352 Nov 4 2018 Library
-rw-r--r-- 1 dannyboy admin 3918 May 23 2016 README.md
drwxrwxr-x 33 dannyboy admin 1056 Nov 4 2018 bin
drwxr-xr-x 3 dannyboy admin 96 Nov 4 2018 etc
lrwxr-xr-x 1 dannyboy admin 27 May 22 2016 hadoop -> /usr/local/hadoop-2.7.2-src
drwxr-xr-x# 22 dannyboy staff 704 Nov 4 2018 hadoop-2.7.2-src
-rw-r--r--# 1 dannyboy staff 110520320 May 22 2016 hadoop-2.7.2-src.tar
drwxrwxr-x 30 dannyboy admin 960 Nov 4 2018 include
drwxrwxr-x 23 dannyboy admin 736 Nov 4 2018 lib
drwxr-xr-x 5 dannyboy wheel 160 Nov 4 2018 man
lrwxr-xr-x 1 dannyboy wheel 27 Jan 18 2014 mysql -> mysql-5.6.15-osx10.7-x86_64
drwxr-xr-x 18 dannyboy wheel 576 Nov 4 2018 mysql-5.6.15-osx10.7-x86_64
-rw-r--r-- 1 dannyboy owner 1536 Jan 18 2014 mysql_db_backup_20140118.libertyrocks.tar
drwxr-xr-x 5 dannyboy admin 160 Nov 4 2018 opt
drwxr-xr-x 3 dannyboy wheel 96 Nov 4 2018 remotedesktop
drwxrwxr-x 9 dannyboy admin 288 Nov 4 2018 share
Also requested...
MacBook-Pro:usr dannyboy$ ls -l /usr
total 0
drwxr-xr-x 971 root wheel 31072 May 15 01:37 bin
drwxr-xr-x 307 root wheel 9824 May 15 01:37 lib
drwxr-xr-x 250 root wheel 8000 May 15 01:37 libexec
drwxr-xr-x 27 root wheel 864 Nov 4 2018 local
drwxr-xr-x 239 root wheel 7648 May 15 01:37 sbin
drwxr-xr-x 46 root wheel 1472 Nov 4 2018 share
drwxr-xr-x 5 root wheel 160 Sep 21 2018 standalone

Related

Exception: null. The flutter tool cannot access the file or directory

I try to using Flutter in Ubuntu 18.04.5 LTS. with Android Studio 4.1.2.
When I try to run flutter app to a real device, I'm getting this error:
Exception: null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
The permissions output of the Flutter SDK:
-rw-rw-rw- 1 yacine yacine 10620 Feb 26 14:51 analysis_options.yaml
-rw-rw-rw- 1 yacine yacine 2879 Feb 26 14:51 AUTHORS
-drwxrwxrwx 4 yacine yacine 4096 Feb 26 14:51 bin
-rw-rw-rw- 1 yacine yacine 2723 Jan 25 20:42 CODE_OF_CONDUCT.md
-rw-rw-rw- 1 yacine yacine 711 Jan 25 20:42 CODEOWNERS
-rw-rw-rw- 1 yacine yacine 5184 Feb 26 14:51 CONTRIBUTING.md
-rw-rw-rw- 1 yacine yacine 1591 Feb 26 14:51 dartdoc_options.yaml
-drwxrwxrwx 15 yacine yacine 4096 Feb 26 14:51 dev
-drwxrwxrwx 13 yacine yacine 4096 Jan 25 20:45 examples
-rw-rw-rw- 1 yacine yacine 1731 Jan 25 20:42 flutter_console.bat
-rw-rw-rw- 1 yacine yacine 296 Jan 25 20:45 flutter_root.iml
-rw-rw-rw- 1 yacine yacine 1519 Jan 25 20:42 LICENSE
-drwxrwxrwx 13 yacine yacine 4096 Feb 26 14:51 packages
-rw-rw-rw- 1 yacine yacine 1107 Jan 25 20:42 PATENT_GRANT
-rw-rw-rw- 1 yacine yacine 4643 Feb 26 14:51 README.md
-rw-rw-rw- 1 yacine yacine 3342 Feb 26 14:51 SECURITY.md
-rw-rw-rw- 1 yacine yacine 14 Feb 26 15:55 version
Short answer: Change the permission of the flutter SDK folder + the permission of the project.
Long answer: After I try many things I found the solution for my problem: All what I try to do from the first time is to change the permission of my flutter SDK folder. But what I did not expect is to change the permission of my project ( Because I was using it without the appearance of this problem ). What I did to resolve the problem is to change the directory of my project from:
/media/yacine/File/Projects/Android/flutter_app
with this permission
drwxrwxr-x 1 yacine users 4096 Feb 26 18:37 flutter_app
to:
/home/yacine/flutter_app
with this permission
drwxrwxr-x 13 yacine yacine 4096 Feb 27 01:12 flutter_app

'uvloop' has no attribute 'EventLoopPolicy'

I am testing python code performance with uvloop. I am getting 'uvloop' has no attribute 'EventLoopPolicy' error.
I am using python 3.7 and
uvloop 0.13.0
pycharm
I tried changing interpreter reinstalling uvloop but none of them did not work.
Can anyone suggest what is the problem?
Rename your own file to something else than uvloop.py, such as test_uvloop.py.
You're confusing Python's import machinery by having your own file the same name as the library you're trying to use.
I see that you're on a Mac, but I just fixed this problem on my CentOS7.x server by properly setting permissions to the uvloop Python package. It's pesky because (at least on CentOS) some pip-installed Python packages go in /usr/local/lib/python3.7/site-packages and some go in /usr/local/lib64/python3.7/site-packages.
Check out what the files in my lib64 directory looked like before I fixed it:
me#myserver /usr/local/lib64/python3.7/site-packages
$ ll
total 16
drwxr-xr-x. 3 root root 4096 Jan 17 15:38 click
drwxr-xr-x. 2 root root 134 Jan 17 15:38 Click-7.0.dist-info
drwxr-x---. 4 root root 74 Jan 17 15:42 httptools
drwxr-x---. 2 root root 141 Jan 17 15:42 httptools-0.0.13-py3.6.egg-info
drwxr-x---. 3 root root 4096 Jan 17 15:43 pydantic
drwxr-x---. 2 root root 111 Jan 17 15:43 pydantic-1.3.dist-info
drwxr-x---. 5 root root 4096 Jan 17 15:43 uvloop
drwxr-x---. 2 root root 141 Jan 17 15:43 uvloop-0.14.0-py3.6.egg-info
drwxr-xr-x. 4 root root 4096 Jan 17 15:38 websockets
drwxr-xr-x. 2 root root 134 Jan 17 15:38 websockets-8.1.dist-info
Unless I was running as a root user the uvloop files are untouchable and that's what caused the error. On your Mac, try to find where your uvloop package is installed and make sure your script can access it.

How to fix missing library after update and upgrade of Homebrew

I decided to update and upgrade Homebrew on a Friday afternoon (because why not) and it appears to have resulted in a missing library that's affecting my ability to run pretty much everything (PHP, Laravel Valet, Node, etc...) The error message on each is the same, so I'm hoping this is a simple fix, but I'm not sure where to begin.
Chriss-MacBook-Pro-2:~ chris$ node --version
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
Abort trap: 6
Chriss-MacBook-Pro-2:~ chris$ valet
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Password:
Sorry, try again.
Password:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
/usr/local/bin/valet: line 54: 729 Abort trap: 6 php "$DIR/cli/valet.php" "$#"
Chriss-MacBook-Pro-2:~ chris$ php --version
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Abort trap: 6
They all appear to be looking for the library in /usr/local/opt/icu4c/lib/libicui18n.61.dylib
** EDIT **
I ran the brew command suggested by Styx and here is the output:
Chriss-MacBook-Pro-2:~ chris$ brew link icu4c
Warning: Refusing to link macOS-provided software: icu4c
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
Adding icu4c to my path is easy enough, but I'm not sure what to do about the second part asking to me to set
** Update **
Here is the output from running ls -l /usr/local/opt/icu4c/lib/
total 131128
drwxr-xr-x 6 chris staff 192 Apr 17 15:42 icu
-rw-r--r-- 1 chris staff 27537504 May 31 14:04 libicudata.64.2.dylib
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicudata.64.dylib -> libicudata.64.2.dylib
-r--r--r-- 1 chris staff 27532496 Apr 17 15:42 libicudata.a
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicudata.dylib -> libicudata.64.2.dylib
-r--r--r-- 1 chris staff 2578452 May 31 14:04 libicui18n.64.2.dylib
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicui18n.64.dylib -> libicui18n.64.2.dylib
-r--r--r-- 1 chris staff 4700120 Apr 17 15:42 libicui18n.a
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicui18n.dylib -> libicui18n.64.2.dylib
-r--r--r-- 1 chris staff 61280 May 31 14:04 libicuio.64.2.dylib
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuio.64.dylib -> libicuio.64.2.dylib
-r--r--r-- 1 chris staff 68744 Apr 17 15:42 libicuio.a
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuio.dylib -> libicuio.64.2.dylib
-rw-r--r-- 1 chris staff 67124 May 31 14:04 libicutest.64.2.dylib
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicutest.64.dylib -> libicutest.64.2.dylib
-r--r--r-- 1 chris staff 79432 Apr 17 15:42 libicutest.a
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicutest.dylib -> libicutest.64.2.dylib
-r--r--r-- 1 chris staff 174512 May 31 14:04 libicutu.64.2.dylib
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicutu.64.dylib -> libicutu.64.2.dylib
-r--r--r-- 1 chris staff 235368 Apr 17 15:42 libicutu.a
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicutu.dylib -> libicutu.64.2.dylib
-rw-r--r-- 1 chris staff 1578232 May 31 14:04 libicuuc.64.2.dylib
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuuc.64.dylib -> libicuuc.64.2.dylib
-r--r--r-- 1 chris staff 2498616 Apr 17 15:42 libicuuc.a
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuuc.dylib -> libicuuc.64.2.dylib
drwxr-xr-x 5 chris staff 160 May 31 14:04 pkgconfig
It seems your icu4c has been upgraded, but your php/node are still refer to an older version.
You can:
Reinstall software which depends on icu4c:
brew uses --installed icu4c | xargs brew reinstall
Switch to using older version of icu4c:
brew switch icu4c 61.2

OpenJDK-9 JDK not present on Ubuntu 17.10

I'm trying to install java 9 jre and jdk on ubuntu. But i cannot find it. I installed all the packages:
ii openjdk-9-jdk:amd64 9~b181-4 amd64 OpenJDK Development Kit (JDK)
ii openjdk-9-jdk-headless:amd64 9~b181-4 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-9-jre:amd64 9~b181-4 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-9-jre-headless:amd64 9~b181-4 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
Java -version returns:
openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
javac -version:
javac 9-Ubuntu
But when I try to create JDK in new Intellij:
Then i get error:
I checked the content of /usr/lib/jvm/ and:
For java-8-openjdk-amd64:
drwxr-xr-x 7 root root 4096 gru 17 16:16 ./
drwxr-xr-x 4 root root 4096 gru 18 18:11 ../
lrwxrwxrwx 1 root root 22 paź 24 00:43 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION
drwxr-xr-x 2 root root 4096 gru 17 16:16 bin/
lrwxrwxrwx 1 root root 41 paź 24 00:43 docs -> ../../../share/doc/openjdk-8-jre-headless/
drwxr-xr-x 3 root root 4096 gru 17 16:16 include/
drwxr-xr-x 5 root root 4096 gru 17 16:16 jre/
drwxr-xr-x 3 root root 4096 gru 17 16:16 lib/
drwxr-xr-x 4 root root 4096 gru 17 16:16 man/
lrwxrwxrwx 1 root root 20 paź 24 00:43 src.zip -> ../openjdk-8/src.zip
lrwxrwxrwx 1 root root 22 paź 24 00:43 THIRD_PARTY_README -> jre/THIRD_PARTY_README
For java-9-openjdk-amd64:
drwxr-xr-x 9 root root 4096 gru 18 18:11 ./
drwxr-xr-x 4 root root 4096 gru 18 18:11 ../
drwxr-xr-x 2 root root 4096 gru 18 18:11 bin/
drwxr-xr-x 4 root root 4096 gru 18 18:11 conf/
lrwxrwxrwx 1 root root 41 sie 24 19:15 docs -> ../../../share/doc/openjdk-9-jre-headless/
drwxr-xr-x 3 root root 4096 gru 18 18:11 include/
drwxr-xr-x 2 root root 4096 gru 18 18:11 jmods/
drwxr-xr-x 77 root root 4096 gru 18 18:11 legal/
drwxr-xr-x 5 root root 4096 gru 18 18:11 lib/
drwxr-xr-x 4 root root 4096 gru 18 18:11 man/
lrwxrwxrwx 1 root root 20 sie 24 19:15 src.zip -> ../openjdk-9/src.zip
My question is what went wrong? To install java-9 i used:
sudo apt install openjdk-9-jre openjdk-9-jdk
I found an issue on idea tracker
https://youtrack.jetbrains.com/issue/IDEA-178743
It's fixed. Also users suggested x86_64- version. Try with it.(source)

Linux Build Package - Configure Script Throws Error, But it's Wrong

Server: SLES v11 sp3
Kernel: 3.0.101-0.47.71-default
Arch: x86_64
So I am trying to build a src package and when I run the "./configure" script it's throwing some errors that required packages are missing. Since it's x86_64 I thought adding "--libdir=/usr/lib64" or "--libdir=/lib64" would help it find the packages it's looking for but I get the same error either way.
The configure Script is failing with this error:
..........
...SNIP...
..........
checking for xgettext... (cached) /usr/bin/xgettext
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GEDIT... configure: error: Package requirements (
glib-2.0 >= 2.13.0
gio-2.0 >= 2.16.0
gtk+-2.0 >= 2.13.0
gconf-2.0 >= 1.1.11
gtksourceview-2.0 >= 2.5.1
gedit-2.20 >= 2.25.4
) were not met:
No package 'glib-2.0' found
No package 'gio-2.0' found
No package 'gtk+-2.0' found
No package 'gconf-2.0' found
No package 'gtksourceview-2.0' found
No package 'gedit-2.20' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GEDIT_CFLAGS
and GEDIT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I checked to make sure I actually have these packages and it seems as though I do. So I'm not sure if it's just not finding them or what... And it also seems as though I have versions of those packages >= what they are asking for, so I'm kinda stumped...
My Installed packages are:
# rpm -qa | grep -i glib-2
libglib-2_0-0-2.22.5-0.8.14.1
# rpm -qa | grep -i 'gtk2'
gtk2-32bit-2.18.9-0.35.1
gtk2-2.18.9-0.35.1
gtk2-engines-2.16.1-4.26
gtk2-branding-SLES-for-VMware-11.1-0.5.99
gtk2-engines-32bit-2.16.1-4.26
gtk2-themes-0.1-737.22
gtk2-lang-2.18.9-0.35.1
gtk2-theme-SLES-for-VMware-11.1-0.7.95
# rpm -qa | grep -i 'gio'
libgio-2_0-0-32bit-2.22.5-0.8.14.1
libgio-2_0-0-2.22.5-0.8.14.1
# rpm -qa | grep -i 'gconf2'
gconf2-2.28.0-1.8.1
gconf2-lang-2.28.0-1.8.1
# rpm -qa | grep -i 'gtksource'
gtksourceview-lang-2.8.2-0.1.195
libgtksourceview-2_0-0-2.8.2-0.1.195
python-gtksourceview-2.4.0-1.32
# rpm -qa | grep -i 'gedit'
gedit-2.28.3-0.8.1
gedit-lang-2.28.3-0.8.1
Anyone have any ideas what the issue could be here? I'm not sure what else to try..?
I had also tried installing the RPM based package but get similar errors for missing packages. See RPM Installation error below...
warning: gedit-plugins-2.28.0-2.el6.x86_64.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID c105b9de
error: Failed dependencies:
GConf2 is needed by gedit-plugins-2.28.0-2.el6.x86_64
pygobject2 is needed by gedit-plugins-2.28.0-2.el6.x86_64
pygtk2 is needed by gedit-plugins-2.28.0-2.el6.x86_64
pygtksourceview is needed by gedit-plugins-2.28.0-2.el6.x86_64
rpmlib(FileDigests) <= 4.6.0-1 is needed by gedit-plugins-2.28.0-2.el6.x86_64
If anyone has ANY thoughts or suggestions please feel free to reply, it would be much very appreciated!
Thanks in Advance,
Matt
Well I was unable to resolve those errors directly with compiling... However, we have another server with the same OS and everything that already had that package installed (which added more to my confusion why it wasn't working) so to just give it a try I copied that server's directory "/usr/lib64/gedit-2/plugins" to the one I was working on and now everything seems to be working just fine. All the plugins were able to be activated and they seem to work.!
The contents of the directory that I copied over were:
/usr/lib64/gedit-2/plugins # ll
total 700
drwxr-xr-x 4 root root 4096 Apr 28 2015 advancedfind
-rwxr-xr-x 1 root root 216 Apr 28 2015 advancedfind.gedit-plugin
-rw-r--r-- 1 root root 9856 Nov 13 2012 changecase.gedit-plugin
-rw-r--r-- 1 root root 6970 Apr 17 2014 codecomment.gedit-plugin
-rw-r--r-- 1 root root 9563 Mar 18 2014 codecomment.py
-rw-r--r-- 1 root root 8850 Apr 16 2014 codecomment.pyc
-rw-r--r-- 1 root root 8745 Mar 18 2014 codecomment.pyo
-rw-r--r-- 1 root root 18084 Nov 13 2012 docinfo.gedit-plugin
drwxr-xr-x 2 root root 4096 Jul 2 2013 externaltools
-rw-r--r-- 1 root root 9243 Nov 13 2012 externaltools.gedit-plugin
-rw-r--r-- 1 root root 8579 Nov 13 2012 filebrowser.gedit-plugin
-rw-r--r-- 1 root root 179 Apr 17 2014 gpdefs.py
-rw-r--r-- 1 root root 317 Apr 17 2014 gpdefs.pyc
-rw-r--r-- 1 root root 315 Apr 17 2014 gpdefs.pyo
-rw-r--r-- 1 root root 9654 Nov 13 2012 indent.gedit-plugin
-rwxr-xr-x 1 root root 18936 Nov 13 2012 libchangecase.so
-rwxr-xr-x 1 root root 19032 Nov 13 2012 libdocinfo.so
-rwxr-xr-x 1 root root 170256 Nov 13 2012 libfilebrowser.so
-rwxr-xr-x 1 root root 14816 Nov 13 2012 libindent.so
-rwxr-xr-x 1 root root 27320 Nov 13 2012 libmodelines.so
-rwxr-xr-x 1 root root 23248 Nov 13 2012 libsort.so
-rwxr-xr-x 1 root root 82168 Nov 13 2012 libspell.so
-rwxr-xr-x 1 root root 36104 Nov 13 2012 libtaglist.so
-rwxr-xr-x 1 root root 35840 Nov 13 2012 libtime.so
-rw-r--r-- 1 root root 9177 Nov 13 2012 modelines.gedit-plugin
drwxr-xr-x 2 root root 4096 Jul 2 2013 pythonconsole
-rw-r--r-- 1 root root 8602 Nov 13 2012 pythonconsole.gedit-plugin
drwxr-xr-x 2 root root 4096 Jul 2 2013 quickopen
-rw-r--r-- 1 root root 5719 Nov 13 2012 quickopen.gedit-plugin
drwxr-xr-x 2 root root 4096 Mar 20 2015 sessionsaver
-rw-r--r-- 1 root root 6035 Mar 20 2015 sessionsaver.gedit-plugin
drwxr-xr-x 2 root root 4096 Jul 2 2013 snippets
-rw-r--r-- 1 root root 8805 Nov 13 2012 snippets.gedit-plugin
-rw-r--r-- 1 root root 9235 Nov 13 2012 sort.gedit-plugin
-rw-r--r-- 1 root root 9416 Nov 13 2012 spell.gedit-plugin
-rw-r--r-- 1 root root 16794 Nov 13 2012 taglist.gedit-plugin
-rw-r--r-- 1 root root 11861 Nov 13 2012 time.gedit-plugin
And since all these plugins seem to be working without any issuse I guess the configure script was wrong about the missing requirements as I had thought...
Thanks anyways....!

Resources