node.js - node-libxml-xsd 在进行 node-gyp 重建时失败,并显示“...xmljs.node:文件无法识别:文件格式无法识别”
问题描述
尝试为 Meteor 应用程序创建 Docker 容器时,尝试编译node-libxml-xsd时node-gyp 重建失败,并出现以下错误:
<command-line>:0:0: note: this is the location of the previous definition
SOLINK_MODULE(target) Release/obj.target/node-libxml-xsd.node
/home/docker/data/app/programs/server/npm/node_modules/libxmljs-mt/build/Release/xmljs.node: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/node-libxml-xsd.node] Error 1
node-libxml-xsd.target.mk:133: recipe for target 'Release/obj.target/node-libxml-xsd.node' failed
make: Leaving directory '/home/docker/data/app/programs/server/npm/node_modules/libxml-xsd/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.9.93-boot2docker
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/docker/data/app/programs/server/npm/node_modules/libxml-xsd
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libxml-xsd@0.5.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxml-xsd@0.5.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我正在使用 Node 8.9.4 在 Mac (boot2docker) 上构建它。有任何想法吗?
解决方案
我找到了答案,所以我为后代发布:
原来 libxml-xsd 不会先重建 libxmljs-mt,所以在运行 npm install 之前,我需要运行:
cd npm && npm rebuild --unsafe-perm libxmljs-mt
推荐阅读
- python - Python 代码在一种环境中工作,但在另一种环境中出错
- ios - 我可以在发布之前使用真正的 admob 广告进行一次测试吗?
- python - 为什么海龟的 xcor() 函数不改变值?
- c++ - Qt 和 Intel realsense 入门
- python - 使用熊猫提取列位置而不是列名?
- asp.net - 一项下拉更改正在更改所有其他下拉选择值
- r - R knitr save_kable 纯html输出
- python - 如何在 Python 中打开 .csv 文件
- java - Java从其他两个具有不同对象和公共属性的列表构建一个列表
- python - 替换 Word 2000 doc 中的图像