We’ll get you there, don’t worry!
Firstly, the directory output that you showed looks fairly correct (except that only npm is a symlink but I don’t know if that matters; as I said I am no nodejs expert)…
So lets check that you have a node.js
version of jade
installed:
tmartin:dart:~> npm ll -g jade
/home/tmartin/local/nodejs/lib
jade@1.11.0
A clean, whitespace-sensitive template language for writing HTML
git://github.com/jadejs/jade.git
http://jade-lang.com
The path that it displays at the top will be different for you since my nodejs is installed just for me and not for the system as a whole (as it appears yours may be).
If that doesn’t return a value, then you would do npm install -g jade
and then try again.
Now that we know that you definitely have a node.js jade installed,there are two things we can try here to try and find the jade we need.
The path that it outputs above is where it thinks this is installed. For me, it was /home/tmartin/local/nodejs/lib
.
See if this sequence of commands works for you using the path it shows you. I’m not sure that it will but we can see. It may or may not be the same place where npm
is installed, for example.
tmartin:dart:~> cd /home/tmartin/local/nodejs/lib
tmartin:dart:~/local/nodejs/lib> cd ..
tmartin:dart:~/local/nodejs> cd bin
tmartin:dart:~/local/nodejs/bin> ls -l
total 22108
lrwxrwxrwx 1 tmartin users 35 Nov 23 2015 bower -> ../lib/node_modules/bower/bin/bower*
lrwxrwxrwx 1 tmartin users 36 Jul 28 15:47 jade -> ../lib/node_modules/pug-cli/index.js*
lrwxrwxrwx 1 tmartin users 27 Nov 23 2015 n -> ../lib/node_modules/n/bin/n*
lrwxrwxrwx 1 tmartin users 59 Nov 23 2015 ncu -> ../lib/node_modules/npm-check-updates/bin/npm-check-updates*
-rwxrwxr-x 1 tmartin users 22607301 Nov 3 2015 node*
lrwxrwxrwx 1 tmartin users 44 Nov 29 2015 node-gyp -> ../lib/node_modules/node-gyp/bin/node-gyp.js*
lrwxrwxrwx 1 tmartin users 38 Nov 3 2015 npm -> ../lib/node_modules/npm/bin/npm-cli.js*
lrwxrwxrwx 1 tmartin users 51 Nov 23 2015 npm-check-updates -> ../lib/node_modules/npm-check-updates/bin/old-alias*
lrwxrwxrwx 1 tmartin users 38 Mar 25 20:48 tsc -> ../lib/node_modules/typescript/bin/tsc*
lrwxrwxrwx 1 tmartin users 37 Nov 23 2015 tslint -> ../lib/node_modules/tslint/bin/tslint*
lrwxrwxrwx 1 tmartin users 43 Mar 25 20:48 tsserver -> ../lib/node_modules/typescript/bin/tsserver*
lrwxrwxrwx 1 tmartin users 33 Nov 23 2015 yo -> ../lib/node_modules/yo/lib/cli.js*
If that works, that’s the location of the jade binary to use in the next steps.
If it doesn’t, we can try something like this; this asks npm where the root for the globally installed modules are. We can then try to then use that to find where jade was actually installed. This doesn’t find you the handy symlinked jade name, but it will at least get things up and running for you, which has to be a net win
tmartin:dart:~> npm root -g
/home/tmartin/local/nodejs/lib/node_modules
tmartin:dart:~> cd /home/tmartin/local/nodejs/lib/node_modules
tmartin:dart:~/local/nodejs/lib/node_modules> cd jade/bin/
tmartin:dart:~/local/nodejs/lib/node_modules/jade/bin> ls -l
total 8
-rwxrwxrwx 1 tmartin users 7889 Jun 6 2015 jade.js*
If that works, then this is the path you want to use; you will also want to change the name of the task that runs from jade
to jade.js
.
As a final last ditch effort, you can run a command like this:
tmartin:dart:~> find / -name jade -type f -print
This can take a long time to finish, and be prepared for it to throw a lot of Permission denied
errors for paths that you don’t have the user rights to look inside (this is no worry since if you can’t look inside you probably can’t run anything inside it either).
This will spit out all of the possible files named jade
and then you just have to figure out which one is the one that you want (i.e. you don’t want that one that was messing stuff up earlier).
You should be able to run whichever jade you like and see the following (or something similar to it). Anything else and that’s not the jade you want.
###Working Jade via node.js (path will differ)
tmartin:dart:~/local/nodejs/bin> ./jade --version
jade version: 0.1.0
jade-cli version: 0.0.0
The ‘You don’t want any part of it’ jade
tmartin:dart:~> jade --version
jade:I: "openjade" version "1.3.3-pre1"
jade:I: "OpenSP" version "1.5.2"
^C
Those directories should have existed; the user package is where your custom settings are stored, for example. To be sure you’re in the right location, select Preferences > Browse Packages...
from the menu, then navigate inside the User
directory.
The path
you want to include in the file is one of the ones above that worked out. You may need to change the first part of the command
to jade.js
instead, based on what happened above.