Installing Dillinger on Nodejs and Debian

by Martin Monperrus
To install Dillinger on Debian (the markdown editor)

Procedure


######### AS ROOT ###############
# Install libv8
aptitude install libv8-3.8.9.20

# download and install nodejs 
curl -O  https://launchpad.net/~chris-lea/+archive/node.js/+files/nodejs_0.10.3-1chl1%7Elucid1_i386.deb
dpkg -i nodejs_0.10.3-1chl1%7Elucid1_i386.deb

# download install script of npm
curl -L -O http://npmjs.org/install.sh 

# fix install script
# node=`which node 2>&1` -> node=`which nodejs 2>&1`
vi install.sh 

# run the script
sh install.sh

# change permissions of npm
 chmod -R 755 /usr/lib/node_modules/ 

# fix /usr/lib/node_modules/npm/bin/npm-cli.js
# #!/usr/bin/env node -> #!/usr/bin/env nodejs
vi /usr/lib/node_modules/npm/bin/npm-cli.js

######### AS USER ###############
# cloning the repo
git clone git@github.com:joemccann/dillinger.git

# installing the dependencies 
npm i

# running it
nodejs app

Troubleshooting


If you don't run npm i:
# otherwise error: "Error: Cannot find module 'express'"

if you run node version 0.6.x:
curl -O  http://ftp.fr.debian.org/debian/pool/main/n/nodejs/nodejs_0.6.19~dfsg1-6_i386.deb
dpkg -i nodejs_0.6.19~dfsg1-6_i386.deb


/home/martin-no-backup/dillinger/plugins/dropbox/dropbox.js:12
if(fs.existsSync(dropbox_config_file)) {
      ^
TypeError: Object # has no method 'existsSync'
    at Object. (/home/martin-no-backup/dillinger/plugins/dropbox/dropbox.js:12:7)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:32)
    at Function._load (module.js:311:12)
    at Module.require (module.js:359:17)
    at require (module.js:375:17)
    at Object. (/home/martin-no-backup/dillinger/routes/index.js:5:15)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)





Tagged as: