Node Deprecation Warnings
Opened this issue · 8 comments
alexcastillo commented
Currently getting the following deprecation warnings when I run the example:
const Ganglion = require('openbci-ganglion').Ganglion;
const ganglion = new Ganglion();
ganglion.once('ganglionFound', (peripheral) => {
// Stop searching for BLE devices once a ganglion is found.
ganglion.searchStop();
ganglion.on('sample', (sample) => {
/** Work with sample */
console.log(sample.sampleNumber);
for (let i = 0; i < ganglion.numberOfChannels(); i++) {
console.log("Channel " + (i + 1) + ": " + sample.channelData[i].toFixed(8) + " Volts.");
}
});
ganglion.once('ready', () => {
ganglion.streamStart();
});
ganglion.connect(peripheral);
});
// Start scanning for BLE devices
ganglion.searchStart();
(node:96316) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Please turn blue tooth on.
(node:96316) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
andrewjaykeller commented
Turn Bluetooth on?
alexcastillo commented
Bluetooth is on. I'm running Node 7.8.
Could be that.
andrewjaykeller commented
oh i think you need to do <=6
alexcastillo commented
It works though...
But why do I need Node 6?
andrewjaykeller commented
noble
if i remember
andrewjaykeller commented
i tried to do the node engines in the package.json to prevent this, how can we fix this? should we leave this open? any ideas
alexcastillo commented
I think we should leave open. This is just a warning, everything seems to be working.
We could look to see if in your code there is a promise without a .catch()
.
andrewjaykeller commented
ohhh yeah ok haha good