Node-sqlite3: deprecation warnings when used with node v6.0.0

Created on 26 Apr 2016  路  17Comments  路  Source: mapbox/node-sqlite3

Using sqlite with node 6.0.0 (just released) gives numerous warnings likely because of the changes made to address https://github.com/nodejs/node/issues/6216.

(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.

==== JS stack trace =========================================

Security context: 0x2ba0778c9fa9 <JS Object>#0#
    1: .node [module.js:568] [pc=0x34561141e264] (this=0x242bc69e2e59 <an Object with map 0x3ee4e1db53e9>#1#,module=0x1a9de2a804d1 <a Module with map 0x3ee4e1d181b9>#2#,filename=0x1a9de2a80499 <String[115]: /Users/mdouglass/kixeye/km/server/kmservices/node_modules/sqlite3/lib/binding/node-v48-darwin-x64/node_sqlite3.node>)
    2: load [module.js:~447] [pc=0x345611296e16] (this=0x1a9de2a804d1 <a Module with map 0x3ee4e1d181b9>#2#,filename=0x1a9de2a80499 <String[115]: /Users/mdouglass/kixeye/km/server/kmservices/node_modules/sqlite3/lib/binding/node-v48-darwin-x64/node_sqlite3.node>)
    3: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x34561103899d] (this=0x2ba077804189 <undefined>,module=0x1a9de2a804d1 <a Module with map 0x3ee4e1d181b9>#2#,filename=0x1a9de2a80499 <String[115]: /Users/mdouglass/kixeye/km/server/kmservices/node_modules/sqlite3/lib/binding/node-v48-darwin-x64/node_sqlite3ease/method.js:39] [pc=0x345611c7dcdf] (this=0x274080472591 <JS Function Promise (SharedFunctionInfo 0x2cf6541298f1)>#15#,fn=0x1a9de276e6c1 <JS Function promises.push.Promise.try (SharedFunctionInfo 0x2cacd9561b59)>#16#)
   27: startServices(aka startServices) [/Users/mdouglass/kixeye/km/server/kmservices/lib/starter.js:28] [pc=0x345611c7d65f] (this=0x2ba077804189 <undefined>,services=0xb6382013d29 <JS Array[3]>#17#,config=0x232faff60ef1 <JS Object>#14#)
   28: /* anonymous */(aka /* anonymous */) [/Users/mdouglass/kixeye/km/server/kmservices/lib/starter.js:55] [pc=0x345611c7bea8] (this=0x2ba077804189 <undefined>)
   29: arguments adaptor frame: 1->0
   30: tryCatcher(aka tryCatcher) [/Users/mdouglass/kixeye/km/server/kmservices/node_modules/local-logger-service/node_modules/bluebird/js/main/util.js:26] [pc=0x3456113a830b] (this=0x2ba077804189 <undefined>)
   31: arguments adaptor frame: 1->0
   32: _settlePromiseFromHandler [/Users/mdouglass/kixeye/km/server/kmservices/node_modules/local-logger-service
==== C stack trace ===============================

 1: v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute)
 2: node_sqlite3::Database::Init(v8::Local<v8::Object>)
 3: (anonymous namespace)::RegisterModule(v8::Local<v8::Object>)
 4: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)
 5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&))
 6: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>)
 7: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
 8: 0x345610f0961b
 9: 0x34561141e264

Most helpful comment

+1 I was unable to install sqlite3 with node v6.

All 17 comments

Hmm, I think this is coming from https://github.com/mapbox/node-sqlite3/blob/155e45ef57e49398fa396c31bcad4a6607b49e3a/src/macros.h#L58-L63. I presume this needs to be fixed in https://github.com/nodejs/nan but I'm not sure.

Yeah, I think so too, just opened https://github.com/nodejs/nan/issues/558

+1

+1 I was unable to install sqlite3 with node v6.

Is there a way to suppress these warnings for now? I've tried --no-warnings and --no-deprecation but they still show up.

Actually I think I figured out a way. I just rebuilt sqlite3 using nan 2.3.2 instead of the version it wants and the warnings go away. My app seems to be functioning fine.

as per frankhale's suggestion, using nan 2.3.2 does indeed fix the warnings.

Works for me too:

npm install nan@^2.3.2
rm -rf node_modules/sqlite3/node_modules/nan/
npm rebuild sqlite3 --build-from-source

My pull request should fix this. However AppVeyor is saying it failed tests on Windows with node version 0.10.40. Something to do with node-gyp? Don't know how this error is even related.

I wish to know what to put in the book I'm finishing. That is, I landed here due to testing the code for my book on Node.js 6.1, and getting errors like what's shown above. The book is all-but-finished and we're about to do the final round of editing (Node.js Web Development, 3rd edition) ...

In the book I'm telling readers to install specific versions of various packages. If they were to follow the directions but be using 6.x they'll get those errors.

It seems this specific fix is just a matter of updating the nan version dependency, and issuing a small release. I tried the workaround shown above and it worked fine. But I see other tickets on install problems on Windows and 6.x ...

I'd rather update the book with a new version number - but no suitable version exists at the moment - but may have to put in a couple sentences suggesting to use a later version.

@robogeek Fork this repo to your own GH account, include the necessary changes, and link / point to that in your book? If you leave a sentence or two explaining this people should be fine? Like this you'd be in control of the situation, though you'd have to make sure people won't keep trying to use your fork forever but instead are notified to go back to the upstream version soon.

What about @zakdances's pull request? It's been in the queue for 14 days with no response. Yeah AppVeyor is complaining but maybe somebody familiar with that setup can help resolve the pull request issues and it can be merged?

https://github.com/mapbox/node-sqlite3/pull/635

I can confirm that using @zakdances's fork solved this problem for Meteor. I know that's not enough to validate the changes, but at least they help!

+1
I wanted to confirm that I have this problem and that running the npm commands from @langpavel worked

(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.

==== JS stack trace =========================================

Security context: 0x14c176bc9fa9 #0#
1: .node [module.js:568] [pc=0x22b78702de24](this=0x2307240e1229 #1#,module=0x1075253a1 #2#,filename=0x107525379 2: load [module.js:456] [pc=0x22b786e38e72](this=0x1075253a1 #2#,filename=0x107525379 3: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x22b786e3899d](this=0x14c176b04189 ,module=0x1075253a1 #2#,filename=0x107525379 4: _load [module.js:407] [pc=0x22b786e345e2](this=0x2307240e11e1 #3#,request=0x10751e5c1 ,parent=0x10731d6c1 #4#,isMain=0x14c176b04299 JS Function require (SharedFunctionInfo 0x230724058b79)>#6#,module=0x10731d6c1 #4#,__filename=0x10731d689 ,__dirname=0x107321579 )
lect=0x107313771 #10#,sequelize=0x107223851 #11#)
{\n db[modelName].associate(db);\n }\n});\n\nsequelize.sync();\n\ndb.sequelize = sequelize;\ndb.Sequelize = Sequelize;\n\nmodule.exports = db;>,filename=0x294863880599 )
ompile [module.js:541] [pc=0x22b786e41944](this=0x294863880dc1
#16#,content=0x2948638812c1 ', req.body%29;n// res.send%28'hello'%29;n }%29;nnnmodule.exports = router;n>,filename=0x294863880f89 189 ,path=0x23072405bde1 )
5: /* anonymous */ [/Users/sea2574595/dev/Haystack/bin/
www:7] [pc=0x22b786e41c69](this=0x2307240eac41 #24#,exports=0x2307240eac41 #24#,require=0x2307240eaa29 #25#,module=0x2307240ea999 #23#,__filename=0x2307240eac01 ,__dirname=0x2307240eabd9 process with map 0xb22dfd5f2d9>#27#)

==== C stack trace ===============================

1: v8::Template::Set(v8::Localv8::Name, v8::Localv8::Data, v8::PropertyAttribute)
2: node_sqlite3::Database::Init(v8::Localv8::Object)
3: (anonymous namespace)::RegisterModule(v8::Localv8::Object)
4: node::DLOpen(v8::FunctionCallbackInfov8::Value const&)
5: v8::internal::FunctionCallbackArguments::Call(void (_)(v8::FunctionCallbackInfov8::Value const&))
6: v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate_, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>)
7: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object*_, v8::internal::Isolate_)
8: 0x22b786d0961b
Segmentation fault: 11

@seanlarge I believe maintainer wish clean all ugly compile-time warnings (or have no time?) before publish new release, sure @kkaefer, @yhahn, @tmcw, @springmeyer?
Mine is temporaly workaround, but is better than no action.

[email protected] has been released, which is the first one to support node v6.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

milu2003 picture milu2003  路  16Comments

sushantdhiman picture sushantdhiman  路  20Comments

wotermelon picture wotermelon  路  24Comments

royeradames picture royeradames  路  20Comments

springmeyer picture springmeyer  路  29Comments