orbitdb-archive / orbit

A distributed, serverless, peer-to-peer chat application on IPFS
MIT License
1.64k stars 116 forks source link

pnpm installation of orbit not working #173

Closed theobat closed 7 years ago

theobat commented 7 years ago

I cannot find any version of ipfs supporting the --enable-pubsub-experiment flag, still trying to find out what's going on.

➜  orbit git:(master) node_modules/ipfs-daemon/node_modules/go-ipfs-dep/go-ipfs/ipfs --version
ipfs version 0.4.4-dev
➜  orbit git:(master) node_modules/ipfs-daemon/node_modules/go-ipfs-dep/go-ipfs/ipfs --enable-pubsub-experiment
Error: Unrecognized option 'enable-pubsub-experiment'
➜  orbit git:(master) ipfs --version
ipfs version 0.4.4
➜  orbit git:(master) ipfs --enable-pubsub-experiment
Error: Unrecognized option 'enable-pubsub-experiment'
➜  orbit git:(master) 

It seems orbit uses an old version of ipfs provided by the go-ipfs npm package. This actually breaks the current version of orbit as the flag --enable-pubsub-experiment was added recently (and is incidentally not present in the go-ipfs packaged version)

It seems this is a known issue on the go-ipfs package side as referenced in this npm go-ipfs issue but the issue is idle somehow.

For the record my actual error when running npm start :

2016-10-23T14:14:07.990Z [DEBUG] ipfs-daemon: Starting IPFS daemon
2016-10-23T14:14:08.138Z [ERROR] Orbit.Index-Native: Error: non-zero exit code 1
  while running: /home/theophile/.pnpm/.store/subcomandante@1.0.5/_/subcom 10155 /home/theophile/.pnpm/.store/github+haadcode+js-ipfsd-ctl+HEAD/_/node_modules/go-ipfs-dep/go-ipfs/ipfs daemon --enable-pubsub-experiment

  events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn /home/theophile/.pnpm/.store/github+haadcode+js-ipfsd-ctl+HEAD/_/node_modules/go-ipfs-dep/go-ipfs/ipfs ENOENT
    at exports._errnoException (util.js:1026:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:592:11)
    at run (bootstrap_node.js:402:7)
    at startup (bootstrap_node.js:157:9)
    at bootstrap_node.js:521:3
haadcode commented 7 years ago

Pubsub is enabled if you build go-ipfs from master, or you can download it (somewhat older version) from here: https://dist.ipfs.io/go-ipfs/floodsub-2. Floodsub-2 is what haadcode/go-ipfs-dep package uses.

To run it, you need to start the daemon with the flag: ipfs daemon --enable-pubsub-experiment. That should do it.

Let me know if you're still stuck.

theobat commented 7 years ago

thanks @haadcode, my bad i forgot the daemon in the above copypaste (I did run it with and without though the problem was not on ipfs/orbit's end).

The problem resides in the way pnpm handles dependencies I guess... It works perfectly with standard npm install. From my understanding they try to resolve all the dependencies and install every version of an npm package only once in a user defined repo a bit like npm -g would do (and then they symlink to them from each node_module repositories).

I'm going to create an issue on their repo, you can close this.

Note: There is an important (yet not breaking as I thought) problem on npm regarding go-ipfs though, you can reproduce it that way :

haadcode commented 7 years ago

Closing as requested.