netPark / node-openalpr

NodeJS Wrapper for OpenALPR
GNU Affero General Public License v3.0
89 stars 78 forks source link

Mac Issue #1

Closed vivekparekh8 closed 8 years ago

vivekparekh8 commented 9 years ago

Failed at the node-openalpr@1.0.7 install script 'node-pre-gyp install --build-from-source --fallback-to-build'.

kjlaw89 commented 9 years ago

@vivekparekh8 Can you post the entire output from NPM? I might be able to figure out what failed if I could see that.

rodrigosalinas commented 9 years ago

I had that issue also until I updated my node.js to 4+.

hyuni commented 8 years ago

@rodrigosalinas see pull request diff file

https://github.com/netPark/node-openalpr/pull/3/files

gerhardsletten commented 8 years ago

Here is an output for a failed install on osx 10.10.5

$  npm i node-openalpr --save
npm WARN installMany nopt was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany npmlog was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany request was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany semver was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany tar was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany tar-pack was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany mkdirp was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany rc was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
npm WARN installMany rimraf was bundled with node-pre-gyp@0.6.17, but bundled package wasn't found in unpacked tree
-
> node-openalpr@1.0.9 install /Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr
> node-pre-gyp install --build-from-source --fallback-to-build

  CXX(target) Release/obj.target/node_openalpr/src/node_openalpr.o
../src/node_openalpr.cc:133:9: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
        return "";
               ^
../src/node_openalpr.cc:193:20: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
        for (int i = 0; i < regionsArray->Length (); i++) {
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
  SOLINK_MODULE(target) Release/node_openalpr.node
clang: error: no such file or directory: '/usr/lib/libopenalpr.so'
make: *** [Release/node_openalpr.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/opt/nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270: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 Darwin 14.5.0
gyp ERR! command "/usr/local/opt/nvm/versions/node/v4.2.0/bin/node" "/usr/local/opt/nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--build-from-source" "--fallback-to-build" "--module=/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/release/darwin_x64/node_openalpr.node" "--module_name=node_openalpr" "--module_path=/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/release/darwin_x64"
gyp ERR! cwd /Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr
gyp ERR! node -v v4.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/opt/nvm/versions/node/v4.2.0/bin/node /usr/local/opt/nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --build-from-source --fallback-to-build --module=/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/release/darwin_x64/node_openalpr.node --module_name=node_openalpr --module_path=/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/release/darwin_x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 14.5.0
node-pre-gyp ERR! command "/usr/local/opt/nvm/versions/node/v4.2.0/bin/node" "/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/node_modules/.bin/node-pre-gyp" "install" "--build-from-source" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr
node-pre-gyp ERR! node -v v4.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.17
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/opt/nvm/versions/node/v4.2.0/bin/node /usr/local/opt/nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --build-from-source --fallback-to-build --module=/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/release/darwin_x64/node_openalpr.node --module_name=node_openalpr --module_path=/Users/gerhard/Sites/github/skiltapp/node_modules/node-openalpr/release/darwin_x64' (1)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/opt/nvm/versions/node/v4.2.0/bin/node" "/usr/local/opt/nvm/versions/node/v4.2.0/bin/npm" "i" "node-openalpr" "--save"
npm ERR! node v4.2.0
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE 
hyuni commented 8 years ago

@gerhardsletten

do you installed with "npm install node-openalpr"? npm registry not found change binding.gyp.

install following steps:

  1. git clone https://github.com/netPark/node-openalpr
  2. cd node-openalpr
  3. brew install openalpr
  4. npm install
gerhardsletten commented 8 years ago

Hi @hyuni, I had Openalpr allready installed (with brew), so the alpr-command work as it should on my computer. But I wonder if it could be related to node-version and the fact that I use nvm. My current install is node v4.2.0, but I did also try with 'iojs-v3.0.0', 'v4.2.4' and 'v5.0.0'.

BTW when I just did a git clone and 'cd && npm install' I did manage to install it, but I got similar errors as some of the other issues.

But I wonder if making the openalpr work just through a npm intall since it (to me) looks like it depends on stuff installed globally on the host like the dependencies for OpenAlpr.

Just created an express app with a dockerfile that install the openalpr as a shell command which is used through the exec-function in node: express-openalpr-server

hyuni commented 8 years ago

i found @gerhardsletten uploaded install log it that "link /usr/lib/libopenalpr.so"

openalpr was installed using homebrew. u found some openalpr library (ls -la /usr/local/lib) osx dynamic library file extenstion is .dylib. so i linked static library(is libopenalpr-static.a)

retry uninstall openalpr and node-openalpr

gerhardsletten commented 8 years ago

Yes, I installed with homebrew and have the static library in the correct position:

$  ls -la /usr/local/lib/libopenalpr-static.a
lrwxr-xr-x  1 gerhard  admin  49 31 des 14:25 /usr/local/lib/libopenalpr-static.a -> ../Cellar/openalpr/2.2.0/lib/libopenalpr-static.a

Did a brew uninstall & reinstall, but it still fails:

Error: dlopen(/Users/gerhard/Desktop/node-openalpr/release/darwin_x64/node_openalpr.node, 1): Symbol not found: __ZTIN2cv9ExceptionE
  Referenced from: /Users/gerhard/Desktop/node-openalpr/release/darwin_x64/node_openalpr.node
  Expected in: dynamic lookup

    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/gerhard/Desktop/node-openalpr/src/openalpr.js:12:17)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
hyuni commented 8 years ago

@gerhardsletten this PR #9 fixed issue. @kjlaw89 please update npm registry. thanks