views:

83

answers:

1

I'm using OSX 10.5 and playing around with Nodejs. I've managed to install npm and used it to install a couple of plugins. Well at least the installation says it has worked fine but when I try and load them in I get an error

$npm install htmlparser

Installs ok, then I create a file called test with

var htmlparser = require("node-htmlparser");

and run $node test.js I get

var htmlparser = require("node-htmlparser");
node.js:275
        throw new Error("Cannot find module '" + request + "'");

I have this in my .bash_profile file export NODE_PATH="/usr/local/lib/node"

If I clone the GIT repos at this page http://github.com/tautologistics/node-htmlparser and move the file lib/node-htmlparser.js to

~/.node_libraries

then it works fine.

What is the point of using npm to install anything if I have to move the lib file like this? Am I missing something ?

A: 

var htmlparser = require('htmlparser') should work fine, since they knock the 'node' off the name.

FallingBullets