Friday, February 24, 2012

Quick Tip: Install NPM modules globally if you want them in your path

I installed the TDD framework Expresso using NPM.

npm install expresso

But when I tried to run the tool with the bare command expresso, the tool couldn't be found. Of course - it was buried down under the node_modules/expresso/bin folder, which wasn't on my path.

So I installed it globally, by using the -g flag.

npm install expresso -g

And that did the trick! Now all I have to do is type expresso at the command line, and it looks in my /test folder for any test modules, and runs them. Sweet.

No comments:

Post a Comment