xmppo / node-expat

libexpat XML SAX parser binding for node.js
https://github.com/xmppo/node-expat
MIT License
384 stars 97 forks source link

Install fails on node 8 @ Ubuntu 18.04 #192

Closed Redsandro closed 6 years ago

Redsandro commented 6 years ago

Install on Ubuntu 16.04 went fine. Installation on Ubuntu 18.04 failed. Copying the contents of node_modules from the 16.04 machine to 18.04 worked fine.

$ npm install --save node-expat

> node-expat@2.3.17 install /tmp/delme/node_modules/node-expat
> node-gyp rebuild

make: Entering directory '/tmp/delme/node_modules/node-expat/build'
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
../deps/libexpat/lib/xmlparse.c:10:10: fatal error: string.h: No such file or directory
 #include <string.h>                     /* memset(), memcpy() */
          ^~~~~~~~~~
compilation terminated.
deps/libexpat/expat.target.mk:104: recipe for target 'Release/obj.target/expat/deps/libexpat/lib/xmlparse.o' failed
make: *** [Release/obj.target/expat/deps/libexpat/lib/xmlparse.o] Error 1
make: Leaving directory '/tmp/delme/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 (/home/redsandro/.nvm/versions/node/v8.9.3/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.15.0-33-generic
gyp ERR! command "/home/redsandro/.nvm/versions/node/v8.9.3/bin/node" "/home/redsandro/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/delme/node_modules/node-expat
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN delme@1.0.0 No description
npm WARN delme@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-expat@2.3.17 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/redsandro/.npm/_logs/2018-09-06T15_55_34_770Z-debug.log
Redsandro commented 6 years ago

Fixed

sudo apt install build-essential