realdadfish / sparkleshare-dashboard

This is a fork of the NodeJS-driven Dashboard of the free Dropbox alternative SparkleShare
GNU Affero General Public License v3.0
27 stars 15 forks source link

Install trouble: express won't stay with just 2.5. #11

Open pauljohn32 opened 11 years ago

pauljohn32 commented 11 years ago

Hi, I asked last week about a problem running sparkleshare-dashboard. You responded that I needed only express 2.5, and I'm trying my best to pin the version, but when I run the commands that you suggest, I still seem to get the wrong thing.

I did the install in an Emacs shell so I can just show you everything I did, and everything it did.

That builds node-v0.8.22 and, so far as I can tell, I'm following your instructions exactly.

http://pj.freefaculty.org/scraps/SS-dashboard-try.txt

I noticed in your Install.md, you don't actually write in the clone of sparkleshare-dashboard. So I'm guessing that part. And I don't know what "Start a redis instance" means.

I found various other guides on other editions of sparkleshare-dashboard on the Internet, so I tried to adapt those things.

The effort to run ends like so.

Warning: express.createServer() is deprecated, express applications no longer inherit from http.Server, please use:

var express = require("express"); var app = express();

/home/pauljohn/nodejs/sparkleshare-dashboard/app.js:49 app.use(express.compiler({ src: dirname + '/public', enable: ['sass'] })); ^ TypeError: Object function createApplication() { var app = connect(); utils.merge(app, proto); app.request = { __proto: req }; app.response = { proto: res }; app.init(); return app; } has no method 'compiler' at Function. (/home/pauljohn/nodejs/sparkleshare-dashboard/app.js:49:19) at Function.app.configure (/home/pauljohn/nodejs/sparkleshare-dashboard/node_modules/express/lib/application.js:396:61) at Object. (/home/pauljohn/nodejs/sparkleshare-dashboard/app.js:32:5) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.runMain (module.js:492:10) at process.startup.processNextTick.process._tickCallback (node.js:245:9)

pauljohn32 commented 11 years ago

Ah. Maybe I am starting to see what is wrong. In your INSTALL.md, you don't say "clone sparkleshare-dashboard" here and I guessed wrong. It is vital to download of the node_modules in the right spot, inside the cloned sparkleshare-dashboard.

I found various wrong advice on this. For example:

http://www.deepthought.ws/linux/sparkleshare-dashboard/

That has the sequence wrong. They do not put node_modules INSIDE the sparkleshare-dashboard. THey say do the clone, and go in there and run npm install, and that gets the wrong version of express.

I believe the sequence of commands needs to be:

$ git clone https://github.com/tommyd3mdi/sparkleshare-dashboard.git $ cd sparkleshare-dashboard $ npm install express@2.5 express-messages i18n jade connect-redis redis sass mime

It is very important that node_modules be inside sparkleshare-dashboard.

Those other directions would have us download the npm stuff, then clone,then

$ cd sparkleshare-dashboard $ npm install -d

There's a big fail because the right version of express is not INSIDE the sparkleshare-dashboard folder. Instead, that downloads version 3.1.

Supposing I guessed right here, I just need help to know what config.js wants for the address of the repository.

If my user's ~/SparkleShare folder has 2 repositories, "work" and "manuscripts", shouldn't those paths just be like

'/home/pjohns/SparkleShare/workt' ??

I tried that:

$ node app.js stderr: fatal: Not a git repository: '/home/pjohns/SparkleShare/work'

SparkleShare Dashboard listening on port 3000 in development mode

Blokkendoos commented 10 years ago

This is how a fixed the "Not a git repository" error by setting up symlinks to your repo's and have the users share the same group. In the following example, the sparkleshare repo's are held by user 'storage' and the dashboard is run in user 'pi':

pi$ sudo adduser pi storage pi$ sudo ln -s /home/storage/private /home/pi/sparkleshare-dashboard/private_x pi$ sudo ln -s /home/storage/public /home/pi/sparkleshare-dashboard/public_x pi$ sudo vi ~/sparkleshare-dashboard/config.js ... { type: 'git', name: 'Public GIT folder', path: '/home/pi/sparkleshare-dashboard/public_x', pub: true }, { type: 'git', name: 'Private GIT folder', path: '/home/pi/sparkleshare-dashboard/dropbox_x', pub: false } ... pi$ redis-2.6.16/src/redis-server & /opt/node/bin/node ~/sparkleshare-dashboard/app.js &

Regards, Johan