我一直在使用 libicu 来检测在 docker、ubuntu 内部运行的节点应用程序中的字符集。这是通过模块完成的节点 icu 字符集检测器 https://github.com/mooz/node-icu-charset-detector使用的是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)
查看我的 /usr/lib/ ,我没有找到任何与 icu 相关的内容,但安装了 libicu-dev 。
这是我的 docker 文件;
# Pull base image.
FROM dockerfile/ubuntu
WORKDIR /
ADD run.sh /run.sh
#make dirs
RUN mkdir /log
RUN mkdir /app
RUN apt-get install -y supervisor libssl-dev pkg-config wget
# Install Node.js
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
# Append to $PATH variable.
RUN echo '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bash_profile
ADD /supervisord.conf /etc/supervisor/conf.d/supervisord.conf
#get phantomJS
RUN apt-get install libfreetype6 libfontconfig -y
RUN cd /app
RUN npm install phantomjs &>/dev/null
#ICU
RUN apt-get install libicu-dev libicu48 -y
RUN npm install --loglevel silent &>/dev/null
RUN npm update --loglevel silent &>/dev/null
#GET NODE-Supervisor
RUN cd /
RUN npm install --loglevel silent -g supervisor
RUN chmod 755 /*.sh
CMD ["/run.sh"]
感谢您对这个问题的任何帮助,因为我的 Linux 知识已经结束了:(
您正在安装 libicu 4.8,但请求的共享库是 libicu 52。因此您需要安装libicu52
改为打包(如果可用)或从以下位置下载预构建的二进制文件(或源代码并编译)here http://site.icu-project.org/download/52#TOC-ICU4C-Download.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)