Comments (10)
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.
Yeah, this is a problem. No readable error text.
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.
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.
I've added bluebird
into packages.json, and then add require
on top of my script.
Script start and finish correctly.
from asyncawait.
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.
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.
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.
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.
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.
That's great to hear! I'll close this issue then. Happy coding.
from asyncawait.
Related Issues (20)
- Fibers are more flexible(?) HOT 18
- Use with ES6 classes #2 HOT 1
- Not working on nw.js HOT 1
- Error: await functions, yield functions, and value-returning suspendable functions. HOT 1
- setTimout example? HOT 2
- Unexpected token function HOT 6
- Fiber not running HOT 1
- why so long time require this two packages? HOT 1
- Extra parentheses? HOT 2
- fibers v1.0.16 dependency breaks node 4.x HOT 1
- Using a for loop HOT 2
- await inside an awaited function
- Stuck within await()... HOT 2
- Installation issue on node version 9.0.0 HOT 1
- Using forEach with Callbacks function
- Not an issue, just a thank you. HOT 1
- asyncawait fails to build on Ubuntu 16.04.4 LTS HOT 3
- Examples in typescript HOT 1
- Upgrade fibers package for nodejs 10.x or 12.x HOT 6
- Await behavior in non Async function or normal function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncawait.