Git Product home page Git Product logo

Comments (11)

ybogdanov avatar ybogdanov commented on August 18, 2024

+1

from node-fibers.

laverdet avatar laverdet commented on August 18, 2024

What platform? Could you take a look at the node-fibers and see you can ascertain where the failure is?

from node-fibers.

ybogdanov avatar ybogdanov commented on August 18, 2024

MacOS 10.6.3

$ which node-fibers
/Users/octave/bin/node-fibers

(from /Users/octave/bin/node-fibers):
echo $FIBERS_ROOT
/Users/octave/.node_libraries/[email protected]/src

> console.log(require.resolve('fibers'));
/Users/octave/.node_libraries/[email protected]/index.js

$ ls -la /Users/octave/.node_libraries/[email protected]
total 16
drwxr-xr-x   4 octave  staff   136 Apr  4 17:08 .
drwxr-xr-x  91 octave  staff  3094 Apr  4 17:08 ..
-rwxr-xr-x   1 octave  staff   677 Apr  4 17:08 index.js
-rw-r--r--   1 octave  staff  3616 Apr  4 17:08 package.json.js


$ ls -la /Users/octave/.node_libraries/.npm/fibers/0.2.4/package
total 64
drwxr-xr-x  10 octave  staff   340 Apr  4 17:08 .
drwxr-xr-x   3 octave  staff   102 Apr  4 17:08 ..
-rw-r--r--   1 octave  staff    33 Mar 28 16:31 .gitignore
-rw-r--r--   1 octave  staff  1332 Mar 28 16:31 LICENSE
-rw-r--r--   1 octave  staff   436 Mar 28 16:31 Makefile
-rw-r--r--   1 octave  staff  9103 Mar 28 16:31 README.md
drwxr-xr-x   3 octave  staff   102 Mar 28 16:31 bin
-rw-r--r--   1 octave  staff   873 Mar 28 16:31 fibers.js
-rw-r--r--   1 octave  staff   684 Mar 28 16:31 package.json
drwxr-xr-x  11 octave  staff   374 Apr  4 17:08 src

So, if I'm understand correctly, require.resolve('fibers') works wrong, cause it gives symlinked path instead of real .npm path.
Correct value for $FIBERS_ROOT in my case should be "/Users/octave/.node_libraries/.npm/fibers/0.2.4/package/src".

from node-fibers.

ybogdanov avatar ybogdanov commented on August 18, 2024

Updated npm to v0.3.18 (was v0.2.15).
Problem gone.

from node-fibers.

 avatar commented on August 18, 2024

I'm having this problem again: "Could not find the coroutine shim!"

I had this problem some time ago and @laverdet gave me a kludge for my system that hardwired the shim lookup. This worked but unfortunately I upgraded node shortly thereafter and the kludge broke. I temporarily gave up on fibers.

Now I see @octave's node-sync and it has motivated me to try again. I just upgraded npm from 0.2.12-1 to the latest 1.0.1rc7, uninstalled and reinstalled fibers, and the shim problem didn't go away.

I'm running node 0.4.1 on AWS Ubuntu 10.10 but I suspect my node installation is weird. Unfortunately I don't know how the installation is supposed to look so I can't do much about it. Everything other than fibers has run fine.

Why is the process of finding the shim so sensitive? I seem to remember this being brought up several times.

from node-fibers.

laverdet avatar laverdet commented on August 18, 2024

Sorry guys I've been busy lately so I haven't had a chance to look into this. But in a couple weeks time I should find myself with a wealth of free time. The coroutine shim is still working well on my system, so I'll have to do some hacking to figure out what's happening for you guys.

Fortunately the coroutine shim is probably the easiest part of node-fibers to debug; it's just a short clearly-written bash script. If time is an issue it should only take you 15 minutes of troubleshooting to find out what's failing on your system.

from node-fibers.

 avatar commented on August 18, 2024

I've tried two things that get me around the "cannot find shim" error. Both lead to a seg fault. My first way is to generate my own startup command like so ...

FIBER_SHIM=1 LD_PRELOAD=/root/node_modules/fibers/src/coroutine.so /usr/local/bin/node test.js

The second way is running straight from dist.

I guess I'm going to have to wait. I have nothing waiting for fibers, I just wanted to be able to start using it to make my life easier.

from node-fibers.

ybogdanov avatar ybogdanov commented on August 18, 2024

@mchahn,

try this:

$ echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.bashrc
$ . ~/.bashrc

$ node-fibers

If it doesn't work, try this:

$ sudo npm install https://github.com/0ctave/node-fibers/tarball/master -g

$ node-fibers
?

For debugging fibers shim path, I recommend doing this:

$ node
> require.paths
** look at the value **
> require.resolve('fibers')
** look at the value **

$ which node-fibers
/usr/local/bin/node-fibers (for example)

Then, edit /usr/local/bin/node-fibers and put

...
echo $FIBERS_ROOT
...

In the place where this var was defined.
Then, run "node-fibers" again.

from node-fibers.

 avatar commented on August 18, 2024

Thank you very much. The install from your git-hub did the trick. I wish I understood this stuff better.

Now I can try your node-sync.

from node-fibers.

ybogdanov avatar ybogdanov commented on August 18, 2024

@mchahn, Enjoy!
Bu the way, how did you installed "fibers"? Since npm 1.x you need to specify -g flag, to install it globally. And you need to add a global "node_modules" path to node require.paths manually. Since you have it (after export NODE_PATH command) you can just do "sudo npm install fibers -g".

from node-fibers.

 avatar commented on August 18, 2024

I didn't know any of this. I've always liked my installers to just "install" without my having to know details like -g.

Luckily the NODE_PATH and npm install instructions you gave me did what was needed. Thanks again.

from node-fibers.

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.