Code Monkey home page Code Monkey logo

Comments (10)

yortus avatar yortus commented on July 18, 2024

I see the stack trace, but I can't see the actual exception message in there. What is the text of the error message? And can you show the part of your source code where the error is occurring?

from asyncawait.

thekip avatar thekip commented on July 18, 2024

Yeah, this is a problem. No readable error text.

I run script like this
image

And all content from debug.log i pasted to pastebin.

Also my script contains:

var async = require('asyncawait/async');
var await = require('asyncawait/await');

async(function(){})

from asyncawait.

yortus avatar yortus commented on July 18, 2024

Looking at the stack trace, it seems to be failing at startup trying to load bluebird, on the line:

var Promise = require('bluebird');

Can you try running that line on its own in your source file? Does it work?

from asyncawait.

thekip avatar thekip commented on July 18, 2024

I've added bluebird into packages.json, and then add require on top of my script.
Script start and finish correctly.

from asyncawait.

yortus avatar yortus commented on July 18, 2024

OK. There is something strange about the stack trace. The error appears to come from bluebird as per line 1 of the stack trace. That line indicates the error occurs in the file /home/pi/smarthome/node_modules/asyncawait/node_modules/bluebird/js/main/queue.js.

The current version of bluebird 2.9.34 (that should have been installed with asyncawait) does not have a file at that location. There is a file bluebird/src/queue.js, but that does not contain anything called _makeCapacity as is referenced in line 1 of the stack trace.

So what version of bluebird is installed at /home/pi/smarthome/node_modules/asyncawait/node_modules/bluebird?

from asyncawait.

thekip avatar thekip commented on July 18, 2024

I have installed 2.3.11 which correctly according to package.json in asyncawait package

"dependencies": {
    "bluebird": "~2.3.11",
    "fibers": "~1.0.1",
    "lodash": "v2.4.1"
  },

from asyncawait.

yortus avatar yortus commented on July 18, 2024

I see. There is a _makeCapacity in that version of bluebird, and it is crashing according to your stack trace (but apparently with no error message). I'm not sure how else to help. I'm not sure why bluebird would crash on startup. I've never seen such an error in any other environment and I can't reproduce it.

from asyncawait.

yortus avatar yortus commented on July 18, 2024

I see node-fibers is also there at the bottom of the stack trace. That is a binary module and is not compatible with all platforms and node versions. Perhaps you could try to find out whether node-fibers is compatible with your setup.

You could try that out by doing npm install fibers and then running the following sample taken directly from the node-fibers README:

var Fiber = require('fibers');

function sleep(ms) {
    var fiber = Fiber.current;
    setTimeout(function() {
        fiber.run();
    }, ms);
    Fiber.yield();
}

Fiber(function() {
    console.log('wait... ' + new Date);
    sleep(1000);
    console.log('ok... ' + new Date);
}).run();
console.log('back in main');

The expected output according to the README should be something like:

wait... Fri Jan 21 2011 22:42:04 GMT+0900 (JST)
back in main
ok... Fri Jan 21 2011 22:42:05 GMT+0900 (JST)

from asyncawait.

thekip avatar thekip commented on July 18, 2024

I fixed it! I installed Node.js version 0.10.40 by compiling it on the Raspberry Pi itself. I used this walkthrough: http://www.armhf.com/node-js-for-the-beaglebone-black/

I think the problem is i have the latest Raspberry Pi which has a diffrent CPU architecture from other.
And all binaries from repos are incompatible.

from asyncawait.

yortus avatar yortus commented on July 18, 2024

That's great to hear! I'll close this issue then. Happy coding.

from asyncawait.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.