Looks like the API changed in [email protected] (released in November), but I can't find a changelog or API docs in the repo. So +1 for following semver and -1 for documenting the breaking change? I didn't look hard, could be somewhere other than the repo: https://github.com/couchbase/couchnode
Either way, if you change your dependency to couchbase@^1.0.0 (npm install "couchbase@^1.0.0" should do it) the example code you are following will probably "just work" as intended. ~Ryan On Mon Jan 19 2015 at 5:41:52 PM Ken Wayne <[email protected]> wrote: > I'm trying to follow the tutorial here: > http://docs.couchbase.com/couchbase-sdk-node-1.2/ > > I'm using the most recent version of Node. I get the following > exception when I try to run the example: > C:\Program Files (x86)\nodejs\Ken\hello-couchbase.js:3 > var bucket = new couchbase.Connection({ > ^ > TypeError: undefined is not a function > at Object.<anonymous> (C:\Program Files > (x86)\nodejs\Ken\hello-couchbase.js: > 3:14) > at Module._compile (module.js:456:26) > at Object.Module._extensions..js (module.js:474:10) > at Module.load (module.js:356:32) > at Function.Module._load (module.js:312:12) > at Function.Module.runMain (module.js:497:10) > at startup (node.js:119:16) > at node.js:929:3 > > I didn't get any errors when running "npm install couchbase" but did get > a number of warnings (below). Any thoughts on what I should do? > > npm install couchbase > > > > > [email protected] install C:\Program Files > (x86)\nodejs\node_modules\couchbase > > (node-gyp rebuild 2> builderror.log) || (exit 0) > > > C:\Program Files (x86)\nodejs\node_modules\couchbase>node "C:\Program > Files > (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" > rebuild > Warning: Missing input files: > C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\..\..\..\deps\lcb\contrib\cbsasl\src\config.h > C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\..\..\..\deps\lcb\contrib\cbsasl\include\cbsasl\visibility.h > Building the projects in this solution one at a time. To enable parallel > build, please add the "/m" switch. > client.c > common.c > hmac.c > md5.c > cbsasl.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\libcbsasl.lib > cJSON.c > cjson.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\libcjson.lib > Copying plugins/io/libuv/libuv_io_opts.h to > include/libcouchbase/libuv_io_opts.h > 1 file(s) copied. > Copying plugins/io/libuv/plugin-internal.h to > include/libcouchbase/plugins/io/libuv/plugin-internal.h > 1 file(s) copied. > Copying plugins/io/libuv/plugin-libuv.c to > include/libcouchbase/plugins/io/libuv/plugin-libuv.c > 1 file(s) copied. > Copying plugins/io/libuv/libuv_compat.h to > include/libcouchbase/plugins/io/libuv/libuv_compat.h > 1 file(s) copied. > netbuf.c > mcreq.c > compress.c > forward.c > rope.c > bigalloc.c > chunkalloc.c > libcalloc.c > lcbht.c > http_parser.c > counter.c > get.c > touch.c > observe.c > durability.c > store.c > ..\..\..\deps\lcb\src\operations\durability.c(534): warning C4244: > 'initializing' : conversion from 'double' to 'lcb_SIZE', possible loss of > data [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\couchbase.vcxproj] > stats.c > remove.c > pktfwd.c > bc_cccp.c > bc_http.c > bc_file.c > bc_mcraw.c > confmon.c > bootstrap.c > callbacks.c > cntl.c > dump.c > connspec.c > ..\..\..\deps\lcb\src\cntl.c(456): warning C4244: '=' : conversion from > 'double' to 'unsigned long', possible loss of data [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\couchbase.vcxproj] > ..\..\..\deps\lcb\src\cntl.c(494): warning C4244: '=' : conversion from > 'double' to 'float', possible loss of data [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\couchbase.vcxproj] > handler.c > getconfig.c > http.c > http_io.c > instance.c > legacy.c > negotiate.c > mcserver.c > ..\..\..\deps\lcb\src\legacy.c(171): warning C4996: 'lcb_timer_destroy': > was declared deprecated [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\couchbase.vcxproj] > C:\Program Files > (x86)\nodejs\node_modules\couchbase\deps\lcb\include\libcouchbase/deprecated.h(101) > : see declaration of 'lcb_timer_destroy' > ..\..\..\deps\lcb\src\legacy.c(403): warning C4996: > 'lcb__create_compat_230': Use memcached:// for legacy memcached. For config > cache, use LCB_CNTL_CONFIGCACHE [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\couchbase.vcxproj] > C:\Program Files > (x86)\nodejs\node_modules\couchbase\deps\lcb\include\libcouchbase/deprecated.h(117) > : see declaration of 'lcb__create_compat_230' > newconfig.c > ..\..\..\deps\lcb\src\legacy.c(417): warning C4996: > 'lcb__create_compat_230': Use memcached:// for legacy memcached. For config > cache, use LCB_CNTL_CONFIGCACHE [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\couchbase.vcxproj] > C:\Program Files > (x86)\nodejs\node_modules\couchbase\deps\lcb\include\libcouchbase/deprecated.h(117) > : see declaration of 'lcb__create_compat_230' > nodeinfo.c > iofactory.c > retryq.c > retrychk.c > settings.c > timings.c > utilities.c > wait.c > plugin-select.c > iocp_iops.c > iocp_loop.c > iocp_timer.c > iocp_util.c > couchbase.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\libcouchbase.lib > genhash.c > base64.c > url_encoding.c > gethrtime.c > hashtable.c > hashset.c > hostlist.c > list.c > logging.c > packetutils.c > ringbuffer.c > simplestring.c > couchbase_utils.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\libcouchbase_utils.lib > connect.c > ctx.c > ioutils.c > iotable.c > protoctx.c > manager.c > timer.c > lcbio.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\liblcbio.lib > snappy-c.cc > snappy-sinksource.cc > snappy-stubs-internal.cc > snappy.cc > c:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, > but unwind semantics are not enabled. Specify /EHsc [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\snappy.vcxproj] > c:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, > but unwind semantics are not enabled. Specify /EHsc [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\snappy.vcxproj] > c:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, > but unwind semantics are not enabled. Specify /EHsc [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\snappy.vcxproj] > ..\..\..\deps\lcb\contrib\snappy\snappy.cc(1014): warning C4018: '>=' : > signed/unsigned mismatch [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\snappy.vcxproj] > ..\..\..\deps\lcb\contrib\snappy\snappy.cc(1096): warning C4018: '>=' : > signed/unsigned mismatch [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\deps\lcb\snappy.vcxproj] > snappy.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\libsnappy.lib > ketama.c > vbucket.c > vbucket.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\libvbucket.lib > couchbase_impl.cc > control.cc > constants.cc > transcoder.cc > binding.cc > operations.cc > ..\src\transcoder.cc(82): warning C4344: behavior change: use of explicit > template arguments results in call to 'v8::Local<T> > NanNew<v8::String,char*>(P,int)' [C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\couchbase_impl.vcxproj] > with > [ > T=v8::String, > P=char * > ] > but the regular function 'v8::Local<T> NanNew(const char *,int)' > is a better match > with > [ > T=v8::String > ] > if you expect 'v8::Local<T> NanNew(const char *,int)' to be > called then you need to make it an explicit specialization > with > [ > T=v8::String > ] > cas.cc > uv-plugin-all.c > Creating library C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\couchbase_impl.lib and > object C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\couchbase_impl.exp > Generating code > Finished generating code > couchbase_impl.vcxproj -> C:\Program Files > (x86)\nodejs\node_modules\couchbase\build\Release\\couchbase_impl.node > [email protected] ..\node_modules\couchbase > ├── [email protected] > ├── [email protected] > ├── [email protected] > └── [email protected] ([email protected], [email protected], > [email protected], [email protected], [email protected], > [email protected], [email protected], [email protected], [email protected], > [email protected], [email protected], [email protected], [email protected], > [email protected], [email protected]) > > > npm WARN unmet dependency C:\Program Files > (x86)\nodejs\node_modules\npm\node_mo > dules\couch-login requires request@'~2.9.202' but will load > npm WARN unmet dependency C:\Program Files > (x86)\nodejs\node_modules\npm\node_mo > dules\request, > npm WARN unmet dependency which is version 2.42.0 > -- > You received this message because you are subscribed to the Google Groups > "Couchbase" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/54BDB19E.5040902%40gmail.com > <https://groups.google.com/d/msgid/nodejs/54BDB19E.5040902%40gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAGjmZGzdPjCWV%3DJ-C-ZQ6G98%3DinZQr9RGWVjD_RG_pp%3DQLxxXA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
