devDependencies 'bin' files aren't exposed to 'scripts' like "test" on Windows #2123

TooTallNate opened this Issue Feb 4, 2012 · 3 comments


None yet
3 participants

TooTallNate commented Feb 4, 2012

Say you have this in your package.json:

  "scripts": {
    "test": "mocha"
  "devDependencies": {
    "mocha": "*"

So now I have mocha installed locally, not globally, and when I execute npm test I would expect mocha to be exposed to the PATH, but it isn't, at least on Windows. It's a little hard to test if it's working on Unix since I have ./node_modules/.bin in my $PATH already, so it always works as expected. But currently on Windows I have to change the "test" line to something hacky like:

    "test": "node ./node_modules/mocha/bin/mocha"

Would be killer to get that fixed. Thanks!


domenic commented Feb 4, 2012

I too am curious as to what the "correct" solution is here. For Windows I have

"test": ".\\node_modules\\.bin\\mocha"

which I can't imagine would work on Unix. If it were just "test": "mocha" everything would be great.


isaacs commented Feb 8, 2012

Yes, "test":"mocha" is certainly how it should work. Looking into this now.

isaacs closed this in 21b77a4 Feb 8, 2012


isaacs commented Feb 8, 2012

Will be included in node 0.6.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment