mscdex / node-mariasql

A node.js binding to MariaDB's non-blocking (MySQL-compatible) client library
MIT License
485 stars 73 forks source link

MariaSQL builded deploy #148

Open kaliseo opened 8 years ago

kaliseo commented 8 years ago

Hi guys !

Got a problem, you may help me.

I'm deploying my app using git in production. Since i used mariasql client, got the error : { [Error: Cannot find module '../build/Debug/sqlclient'] code: 'MODULE_NOT_FOUND' }

It's due to mariasql client wich is not builded when retrieving package via bitbucket.

I tried strongloop with slc build to send builded package to bitbucket, but does not change anything. I have to reinstall mariasql module when deploying app in production.

Do you have a solution to sens builded module to bitbucket & install it in production pre-builded ?

Thanks a lot for your help !

Best regards,

Thierry

mscdex commented 8 years ago

Are you mixing major node versions (e.g. v0.10, v0.12, v4.x, v5.x, v6.x, etc.) or trying to use the same compiled addon across different platforms (e.g. Linux and OS X)?

kaliseo commented 8 years ago

You're totaly right ! I'm using different versions of Node between dev & production platform. Do you think it's the reason ?

kaliseo commented 8 years ago

Hum.. Since i upgraded NPM in dev machine, got this error : Error: Cannot find module '../build/Debug/sqlclient'

All time. Tried npm rebuild, remove & reinstall module, nothing works

mscdex commented 8 years ago

You have to make sure major node versions match, not just npm versions. If both dev and production are running within the same release branch (e.g. node v4.0.0 and v4.4.5) there should not be a problem.

RachelScodes commented 8 years ago

Bumping this issue,

Dev and production running same version of node. Tried all of the above. The build/Debug directory never shows up... It's not there, no wonder it can't be found.

mscdex commented 8 years ago

@RachelScodes How are you installing this addon?

RachelScodes commented 8 years ago

"Tried all of the above", meaning:

1 - checked for matching node versions, dev was running node v.5.12.0, made sure local used the same version 2 -npm install mariasql 3 - used sample code to instantiate a client 4 - got the above error 5 - looked in the directory and noticed the build/Debug directory didn't exist. 6 - upgraded dev and local to node v.6.2.2; repeated steps 2-5 7 - looked on the internet and found lots of people with this same bug 8 - tried running node-gyp rebuild 9 - nope. Debug directory still isn't there 10 - deleted everything, cloned directory, ran node-gyp rebuild 11 - same error. directory isn't there.

mscdex commented 8 years ago

@RachelScodes Can you post the console output you get when you npm --loglevel=silly install mariasql or node-gyp rebuild (latter preferred)?

danialm commented 7 years ago

I have a similar problem using node 0.10:

``` ../deps/libmariadbclient/extra/yassl/include/openssl/rsa.h:25:8: error: expected identifier enum { RSA_F4 = 1 }; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/rsa.h:181:18: note: expanded from macro 'RSA_F4' # define RSA_F4 0x10001L ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: In file included from ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:35: ../deps/libmariadbclient/extra/yassl/include/openssl/rsa.h:25:1: warning: declaration does not declare anything [-Wmissing-declarations] enum { RSA_F4 = 1 }; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:87:16: error: elaborated type refers to a typedef typedef struct BIGNUM BIGNUM; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/ossl_typ.h:118:26: note: declared here typedef struct bignum_st BIGNUM; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:119:16: error: elaborated type refers to a typedef typedef struct X509_STORE X509_STORE; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/ossl_typ.h:159:30: note: declared here typedef struct x509_store_st X509_STORE; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:120:16: error: elaborated type refers to a typedef typedef struct X509_LOOKUP X509_LOOKUP; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:134:31: note: declared here typedef struct x509_lookup_st X509_LOOKUP; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:122:16: error: elaborated type refers to a typedef typedef struct X509_CRL X509_CRL; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/ossl_typ.h:154:28: note: declared here typedef struct X509_crl_st X509_CRL; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:123:16: error: elaborated type refers to a typedef typedef struct X509_REVOKED X509_REVOKED; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/ossl_typ.h:156:32: note: declared here typedef struct x509_revoked_st X509_REVOKED; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:124:16: error: elaborated type refers to a typedef typedef struct X509_LOOKUP_METHOD X509_LOOKUP_METHOD; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:157:3: note: declared here } X509_LOOKUP_METHOD; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:131:16: error: elaborated type refers to a typedef typedef struct BIO BIO; ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/bio.h:237:23: note: declared here typedef struct bio_st BIO; ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:160:5: error: expected identifier X509_V_OK = 0, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:312:66: note: expanded from macro 'X509_V_OK' # define X509_V_OK 0 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:161:5: error: expected identifier X509_V_ERR_CERT_CHAIN_TOO_LONG = 1, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:335:66: note: expanded from macro 'X509_V_ERR_CERT_CHAIN_TOO_LONG' # define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:162:5: error: expected identifier X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:315:66: note: expanded from macro 'X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT' # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:163:5: error: expected identifier X509_V_ERR_CERT_NOT_YET_VALID = 3, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:322:66: note: expanded from macro 'X509_V_ERR_CERT_NOT_YET_VALID' # define X509_V_ERR_CERT_NOT_YET_VALID 9 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:164:5: error: expected identifier X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 4, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:326:66: note: expanded from macro 'X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD' # define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:165:5: error: expected identifier X509_V_ERR_CERT_HAS_EXPIRED = 5, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:323:66: note: expanded from macro 'X509_V_ERR_CERT_HAS_EXPIRED' # define X509_V_ERR_CERT_HAS_EXPIRED 10 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:166:5: error: expected identifier X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 6, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:327:66: note: expanded from macro 'X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD' # define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:167:5: error: expected identifier X509_FILETYPE_PEM = 7, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509.h:122:34: note: expanded from macro 'X509_FILETYPE_PEM' # define X509_FILETYPE_PEM 1 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:168:5: error: expected identifier X509_LU_X509 = 8, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:119:34: note: expanded from macro 'X509_LU_X509' # define X509_LU_X509 1 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:169:5: error: expected identifier X509_LU_CRL = 9, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:120:34: note: expanded from macro 'X509_LU_CRL' # define X509_LU_CRL 2 ^ In file included from ../deps/libmariadbclient/extra/yassl/src/ssl.cpp:35: In file included from ../deps/libmariadbclient/extra/yassl/include/yassl_int.hpp:31: In file included from ../deps/libmariadbclient/extra/yassl/include/cert_wrapper.hpp:38: ../deps/libmariadbclient/extra/yassl/include/openssl/ssl.h:170:5: error: expected identifier X509_V_ERR_CRL_SIGNATURE_FAILURE = 10, ^ /Users/dmoazen/.node-gyp/0.10.48/include/node/openssl/x509_vfy.h:321:66: note: expanded from macro 'X509_V_ERR_CRL_SIGNATURE_FAILURE' # define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 33 warnings and 20 errors generated. make: *** [Release/obj.target/yassl/deps/libmariadbclient/extra/yassl/src/ssl.o] Error 1 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:276:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12) gyp ERR! System Darwin 16.4.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/dmoazen/Workspace/centaur/node_modules/mariasql gyp ERR! node -v v0.10.48 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm verb unsafe-perm in lifecycle true npm info mariasql@0.1.24 Failed to exec install script npm verb unlock done using /Users/dmoazen/.npm/_locks/mariasql-889516b61735267e.lock for /Users/dmoazen/Workspace/centaur/node_modules/mariasql npm verb stack Error: mariasql@0.1.24 install: `node-gyp rebuild` npm verb stack Exit status 1 npm verb stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16) npm verb stack at EventEmitter.emit (events.js:98:17) npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) npm verb stack at ChildProcess.emit (events.js:98:17) npm verb stack at maybeClose (child_process.js:766:16) npm verb stack at Process.ChildProcess._handle.onexit (child_process.js:833:5) npm verb pkgid mariasql@0.1.24 npm verb cwd /Users/dmoazen/Workspace/centaur npm ERR! Darwin 16.4.0 npm ERR! argv "node" "/usr/local/bin/npm" "--loglevel=silly" "install" "mariasql" npm ERR! node v0.10.48 npm ERR! npm v2.15.1 npm ERR! code ELIFECYCLE npm ERR! mariasql@0.1.24 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mariasql@0.1.24 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the mariasql 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 mariasql npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls mariasql npm ERR! There is likely additional logging output above. npm verb exit [ 1, true ] npm verb unbuild node_modules/mariasql npm info preuninstall mariasql@0.1.24 npm info uninstall mariasql@0.1.24 npm verb unbuild rmStuff mariasql@0.1.24 from /Users/dmoazen/Workspace/centaur/node_modules npm info postuninstall mariasql@0.1.24 npm sill gentlyRm /Users/dmoazen/Workspace/centaur/node_modules/mariasql is being purged from base /Users/dmoazen/Workspace/centaur npm verb gentlyRm don't care about contents; nuking /Users/dmoazen/Workspace/centaur/node_modules/mariasql npm sill vacuum-fs purging /Users/dmoazen/Workspace/centaur/node_modules/mariasql npm sill vacuum-fs quitting because other entries in /Users/dmoazen/Workspace/centaur/node_modules npm ERR! Please include the following file with any support request: npm ERR! /Users/dmoazen/Workspace/centaur/npm-debug.log ```
mscdex commented 7 years ago

@danialm mariasql v0.1.x is old and some versions had some issues, you will need to upgrade.

danialm commented 7 years ago

what is the latest version?

mscdex commented 7 years ago

@danialm v0.2.6

danialm commented 7 years ago

that worked! thank you so much

danialm commented 7 years ago

Just for the record, I was able to get the mariasql 0.1.x to work with node 0.10. All I did was to brew uninstall node@0.10 and then clean the house and reinstall node 0.10 from node.js website