关闭。这个问题需要details or clarity .它目前不接受答案。
想改进这个问题?通过 editing this post 添加详细信息并澄清问题.
6年前关闭。
Improve this question
我试图在 Ubutun 14.04 上通过 npm 安装 office lib。它不起作用。我使用 Node :v4.4.0,npm:v.2.14.20 和 python:v2.6.9
运行 npm install office 后,我得到以下输出:
make: *** [Release/obj.target/node_expat/node-expat.o] Error 1
make: Leaving directory `/home/apps/lsb.gorillab.co/node_modules/office/node_modul es/xml2json/node_modules/node-expat/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/ node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process. js:200:12)
gyp ERR! System Linux 3.13.0-83-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gy p/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/apps/lsb.gorillab.co/node_modules/office/node_modules/xml2json/ node_modules/node-expat
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm info node-expat@2.0.0 Failed to exec install script
npm ERR! Linux 3.13.0-83-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-d" "office"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! node-expat@2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.0.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm info preuninstall node-expat@2.0.0
npm info uninstall node-expat@2.0.0
npm info postuninstall node-expat@2.0.0
npm info preuninstall xml2json@0.3.2
npm info uninstall xml2json@0.3.2
npm info postuninstall xml2json@0.3.2
npm info preuninstall office@0.0.8
npm info uninstall office@0.0.8
npm info postuninstall office@0.0.8
npm ERR! Please include the following file with any support request:
npm ERR! /home/apps/lsb.gorillab.co/npm-debug.log
非常感谢您提供的任何帮助。
最佳答案
问题是 node-expat
的版本正在安装的版本太旧,无法支持 node v4+。 Node v4+ 兼容性需要更新版本,例如 v2.3.13(这是撰写本文时的最新版本)。
由于node-expat
在这种情况下,作为依赖项安装,您需要遍历依赖项树并让每个模块的维护者在适当的情况下更新其依赖项,从 xml2json
开始然后到 office
.不过,在这种特殊情况下,似乎 xml2json
已经在引入 node-expat
的较新版本它是 office
需要更新其xml2json
依赖。不幸的是 office
模块在 2 年内没有更新,因此如果您想使用该模块,您可能需要自己 fork 并更新依赖项。
关于python - ubuntu npm install lib 错误与 node-expat 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36233846/