Original problem
Segmentation fault: 11 node "
dirname "$0"
This appears to be a bug in V8 exposed by compiling with Clang. It's been fixed in more recent versions of Node, so you'll need to update. The github issue is tracked here
Edit problem
There is no contextify
command-line program that you can run, so which contextify
has nothing to find. The contextify
module is meant to be used within node
by using require('contextify')
to load the module.
Based on how you've described this, it seems like you may be conflating two things. Modules installed with npm install -g
are installed globally and accessible to all node applications, but that does not mean that they will expose a script that can be executed on the command line. -g
only controls the installation path of the module.
Whether a module has a command-line script you can run depends on whether the module's package.json
defines a set of bin
commands, e.g. jshint. When you install with -g
, the scripts listed are symlinked along with node
so they are accessible via your PATH
. When installed without -g
, bin scripts are installed into node_modules/.bin
and you would have to add that directory to your PATH
for scripts to work.