Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a newbie to Node, but I've been trying to install some npm modules and after what seems like a successful install, I can't run the new app. I must have some basic config error, like a missing location in my PATH...

For example, running:

npm install -g karma

I get:

npm http GET
npm http 304
npm http GET
... (many, many GETs......)

> ws@0.4.25 install /usr/local/share/npm/lib/node_modules/karma/node_modules/
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
/usr/local/share/npm/bin/karma -> /usr/local/share/npm/lib/node_modules/karma/bin/karma

> karma@0.8.3 install /usr/local/share/npm/lib/node_modules/karma
> node install-log4js.js

npm http GET
npm http 304
npm http GET
npm http GET
npm http 304
npm http 304
log4js@0.6.2 /usr/local/share/npm/lib/node_modules/log4js
├── dequeue@1.0.3
└── async@0.1.15
karma@0.8.3 /usr/local/share/npm/lib/node_modules/karma
├── pause@0.0.1
├── dateformat@1.0.2-1.2.3
├── xmlbuilder@0.4.2
├── colors@0.6.0-1
├── chokidar@0.6.2
├── growly@1.1.1
├── mime@1.2.9
├── q@0.9.2
├── coffee-script@1.6.2
├── lodash@1.1.1
├── rimraf@2.1.4 (graceful-fs@1.2.0)
├── optimist@0.3.5 (wordwrap@0.0.2)
├── minimatch@0.2.11 (sigmund@1.0.0, lru-cache@2.3.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.0)
├── LiveScript@1.0.1 (prelude-ls@0.6.0)
├── log4js@0.6.2 (dequeue@1.0.3, async@0.1.15)
├── http-proxy@0.10.0 (pkginfo@0.2.3, utile@0.1.7)
├── istanbul@0.1.22 (abbrev@1.0.4, which@1.0.5, fileset@0.1.5, nopt@2.0.0, wordwrap@0.0.2, async@0.1.22, mkdirp@0.3.5, esprima@0.9.9, handlebars@1.0.10, escodegen@0.0.20)
└── (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3,

But when I then try to run:

➤ karma start
fish: Unknown command 'karma'

Of course, if I run it by directly addressing the entire path to karma, it works fine:

/usr/local/share/npm/lib/node_modules/karma/bin/karma start

 Starting Testacular Server (
INFO [karma]: Karma server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 26.0 (Mac)]: Connected on socket id sNhp2l8FW6zQ0iQsiRgR
Chrome 26.0 (Mac): Executed 1 of 1 SUCCESS (0.108 secs / 0.004 secs)

When I npm install something, isn't a symlink created somewhere?

➤ which npm

➤ npm --version
share|improve this question
A symlink is created to the javascript library so that other javascript programs can use it. That has nothing to do with what happens to binaries. – David Schwartz Apr 4 '13 at 1:15
up vote 1 down vote accepted

I did it by adding /usr/local/share/npm/bin to my path. (via editing my .bashrc file)

export PATH=/usr/local/bin:/usr/local/lib:/opt/local/bin:/opt/local/sbin:/usr/local/share/npm/bin:$PATH
share|improve this answer
saved my day, thank you! – eric Jul 27 '13 at 3:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.