openvenues / node-postal

NodeJS bindings to libpostal for fast international address parsing/normalization
MIT License
219 stars 76 forks source link

Can not start node js project #17

Closed toanxyz closed 6 years ago

toanxyz commented 6 years ago

I'm trying to var postal = require('node-postal'); But the system keeps saying errors as below:

webapp@0.0.0 start /home/ups_poc/webapp node ./bin/www

/home/ups_poc/webapp/node_modules/bindings/bindings.js:88 throw e ^

Error: libpostal.so.1: cannot open shared object file: No such file or directory at Object.Module._extensions..node (module.js:664:18) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at bindings (/home/ups_poc/webapp/node_modules/bindings/bindings.js:81:44) at Object. (/home/ups_poc/webapp/node_modules/node-postal/index.js:3:32) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! webapp@0.0.0 start: node ./bin/www npm ERR! Exit status 1 npm ERR!

The detail log as below:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@5.5.1 3 info using node@v8.9.1 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle webapp@0.0.0~prestart: webapp@0.0.0 6 info lifecycle webapp@0.0.0~start: webapp@0.0.0 7 verbose lifecycle webapp@0.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle webapp@0.0.0~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/ups_poc/webapp/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ups_poc/.local/bin:/home/ups_poc/bin 9 verbose lifecycle webapp@0.0.0~start: CWD: /home/ups_poc/webapp 10 silly lifecycle webapp@0.0.0~start: Args: [ '-c', 'node ./bin/www' ] 11 silly lifecycle webapp@0.0.0~start: Returned: code: 1 signal: null 12 info lifecycle webapp@0.0.0~start: Failed to exec start script 13 verbose stack Error: webapp@0.0.0 start: node ./bin/www 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid webapp@0.0.0 15 verbose cwd /home/ups_poc/webapp 16 verbose Linux 3.10.0-693.5.2.el7.x86_64 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v8.9.1 19 verbose npm v5.5.1 20 error code ELIFECYCLE 21 error errno 1 22 error webapp@0.0.0 start: node ./bin/www 22 error Exit status 1 23 error Failed at the webapp@0.0.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Could someone help me with this error? I used CentOS 7.4

avimar commented 4 years ago

What was your issue? I have this issue now despite seemingly a working install.

#pkg-config --cflags --libs libpostal
-I/usr/local/include -L/usr/local/lib -lpostal

# npm install node-postal
... updated 1 package
avimar commented 4 years ago

Found a fix: https://github.com/openvenues/pypostal/issues/8

export LD_LIBRARY_PATH=/usr/local/lib