Node.js libicui18n.so.52:无法打开共享对象文件

Node.js libicui18n.so.52:无法打开共享对象文件,node.js,ubuntu,shared-libraries,docker,icu,Node.js,Ubuntu,Shared Libraries,Docker,Icu,我一直在使用libicu检测运行在ubuntu docker内部的node应用程序中的字符集。这是通过使用libicu-dev包的模块完成的,我在安装npm包之前安装了该包 这一切都很好,但我突然发现了错误 module.js:356 Module._extensions[extension](this, filename); ^ Error: libicui18n.so.52: cannot open shared object

我一直在使用libicu检测运行在ubuntu docker内部的node应用程序中的字符集。这是通过使用
libicu-dev
包的模块完成的,我在安装npm包之前安装了该包

这一切都很好,但我突然发现了错误

module.js:356
  Module._extensions[extension](this, filename);                               ^
Error: libicui18n.so.52: cannot open shared object file: No such file or directory
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/app/node_modules/node-icu-charset-detector/node-icu-charset-detector.js:1:82)

感谢您在这个问题上提供的帮助,因为我已经了解了linux:(

您正在安装libicu 4.8,但请求的共享库是libicu 52。因此,您需要安装
libicu52
包(如果可用)或下载预构建的二进制文件(或源代码并编译)从。

正如@mscdex所指出的,libicu正在寻找libicu52包。不知何故,存储库得到了更新,允许我提取依赖于libicu52的新libicu,该libicu在12.04的存储库中不可用,但在14.04中可用。由于docker注册表中没有官方可信的14.04版本,我建立了自己的“基础”ubuntu14.04 docker镜像,从13.10开始升级到14.04

FROM ubuntu:saucy

ENV DEBIAN_FRONTEND noninteractive
# Work around initramfs-tools running on kernel 'upgrade': <http://bugs.debian.org/cgi-    bin/bugreport.cgi?bug=594189>
ENV INITRD No

# Update OS.
RUN sed -i 's/saucy/trusty/g' /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get dist-upgrade -y

# Install basic packages.
RUN apt-get install -y software-properties-common
RUN apt-get install -y curl git htop unzip vim wget

# Add files.
ADD root/.bashrc /root/.bashrc
ADD root/.gitconfig /root/.gitconfig
ADD root/scripts /root/scripts


RUN apt-get clean

# Set working directory.
ENV HOME /root
WORKDIR /root

CMD ["/bin/bash"]
来自ubuntu的
:俏皮
环境DEBIAN_前端非交互
#解决在内核“升级”上运行的initramfs工具的问题:
环境倡议编号
#更新操作系统。
运行sed-i's/saucy/trusty/g'/etc/apt/sources.list
运行apt获取更新-y
运行apt获取升级-y
运行apt get dist升级-y
#安装基本软件包。
运行apt get install-y软件属性common
运行apt get install-y curl git htop解压vim wget
#添加文件。
添加root/.bashrc/root/.bashrc
添加root/.gitconfig/root/.gitconfig
添加根/脚本/根/脚本
跑去洗干净
#设置工作目录。
环境主页/根目录
WORKDIR/root
CMD[“/bin/bash”]

然后在我员工的Dockerfile中,我安装了libicu52而不是libicu48,从而解决了所有问题

你的答案似乎很基本,我首先认为你是在欺骗我。但你是对的;不知何故,libuci在后台更新了,想要libicu52,它只在ubuntu 14.04中可用。谢谢你的回答,我会写下完整的过程在一个answer@stueja我不太清楚你指的是什么。我既不是问原始问题的人,也不是在偷别人的答案。
FROM ubuntu:saucy

ENV DEBIAN_FRONTEND noninteractive
# Work around initramfs-tools running on kernel 'upgrade': <http://bugs.debian.org/cgi-    bin/bugreport.cgi?bug=594189>
ENV INITRD No

# Update OS.
RUN sed -i 's/saucy/trusty/g' /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get dist-upgrade -y

# Install basic packages.
RUN apt-get install -y software-properties-common
RUN apt-get install -y curl git htop unzip vim wget

# Add files.
ADD root/.bashrc /root/.bashrc
ADD root/.gitconfig /root/.gitconfig
ADD root/scripts /root/scripts


RUN apt-get clean

# Set working directory.
ENV HOME /root
WORKDIR /root

CMD ["/bin/bash"]