19

I got this error after installing nodejs and npm using pacman:

node: error while loading shared libraries: libicui18n.so.68: cannot open shared object file: No such file or directory

I already tried setting LD_LIBRARY_PATH to /usr/local/lib/ and that hasn't worked and I also have tried looking for the file everywhere and haven't found it.

LD_LIBRARY_PATH=/usr/local/lib/
find / -iname libicui18n.so.68
Cadoiz
  • 1,446
  • 21
  • 31
Mat
  • 203
  • 1
  • 2
  • 6
  • 2
    Seems like a flaw in the design of NodeJS. My system uses .70 but one application requires .69 to build. If I do `ls /usr/lib/libicui18n.so.*` I only see version .70 and no previous versions. Whose fault is that? I blame NodeJS :-) – PJ Brunet Jan 22 '22 at 23:12
  • @PJBrunet - what system are you using? I started a thread on this for arch https://bugs.archlinux.org/index.php?do=details&action=details.addvote&task_id=73723 – andre Feb 10 '22 at 19:53
  • 1
    @andre Manjaro. – PJ Brunet Feb 10 '22 at 21:23
  • seems to be a regular occurrence, it happened to me once, then was fixed, now broken again.... – br4nnigan Nov 05 '22 at 21:17
  • Just for reference (I stranded here this way): [this is the same question](https://stackoverflow.com/q/55097675/4575793) for Ubuntu/Debian or other distos based on this. – Cadoiz Jan 26 '23 at 13:39

6 Answers6

14

I ran into the same issue, but updating the system resolved it for me. Use:

$ pacman -Syu
odili
  • 565
  • 5
  • 6
7
sudo pacman -S nodejs                                                                                                                1 ✘ 
resolving dependencies...
looking for conflicting packages...
:: nodejs and nodejs-lts-erbium are in conflict. Remove nodejs-lts-erbium? [y/N] y

Packages (2) nodejs-lts-erbium-12.22.11-1 [removal]  nodejs-18.7.0-1

Total Download Size:   10.22 MiB
Total Installed Size:  38.16 MiB
Net Upgrade Size:      11.81 MiB

re-installing nodejs worked for me

MauricioOtta
  • 301
  • 3
  • 5
  • Just for reference (I stranded here this way): [this is the solution](https://stackoverflow.com/a/55155426/4575793) for Ubuntu/Debian or other distos based on this – Cadoiz Jan 26 '23 at 13:39
  • 1
    I just got this when they retired fermium from the repos. Same solution except I installed another LTS in its place: `pacman -S nodejs-lts-hydrogen`. [ArchWiki: Node.js#Installation](https://wiki.archlinux.org/title/Node.js#Installation) has the updated LTS packages. WARNING: This solution might break some of your NodeJS apps! – ki9 Jul 04 '23 at 18:28
4

libicui18n.so.68 is provided by core/icu package and it is located in /usr/lib

$ pacman -F libicui18n.so
core/icu 65.1-2 [installed: 68.2-1]
usr/lib/libicui18n.so

$ pacman -Qo /usr/lib/libicui18n.so.68
/usr/lib/libicui18n.so.68 is owned by icu 68.2-1
slamp
  • 43
  • 1
  • 5
4

Check what version of node-js you are using.

Try installing nodejs. If you get a conflict that another nodejs is installed that is probably your issue.

Example:

nodejs and nodejs-lts-dubnium are in conflict. Remove nodejs-lts-dubnium? [y/N] y
2

Answer:

Installing these libraries will solve your problem :

sudo pacman -Sy brltty harfbuzz-icu icu

Background :

Couldn't run samba server because of icu and when I try to update package icu it finds conflict for two dependencies. Including them solved icu installation and also solved smb service problem and cleanly restarted samba server ... which was giving an error :

/usr/bin/smbd: error while loading shared libraries: libicui18n.so.71: cannot open shared object file: No such file or directory

icu dependency error was :

X@Y ~ $ sudo pacman -S icu
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing icu (71.1-1) breaks dependency 'libicuuc.so=70-64' required by brltty
:: installing icu (71.1-1) breaks dependency 'libicuuc.so=70-64' required by harfbuzz-icu
Gediz GÜRSU
  • 555
  • 4
  • 12
  • Including some libraries solved to problem brltty harfbuzz-icu and icu. I admit the answer is not clear. However you did not concentrate on the message enough and gave a premature verdict. Thats on you. Nevertheless I fixed it for you. – Gediz GÜRSU Jun 06 '22 at 11:14
  • I reviewed the updated answer. While it doesn't address OP head on, it gives an alternative path towards a solution. Thank you. – vhs Jun 11 '22 at 02:20
1

Basically the same approach as the answer by MauricioOtta, if you installed node with brew. Then you can consider this answer, which gave me:

brew uninstall node
brew install node

It also works on Ubuntu or other distributions with homebrew - maybe even MacOS.

It could be possible to install node with nix-env too.

Cadoiz
  • 1,446
  • 21
  • 31