Running node.js packages on Windows outside the bin dir
I’m using the Node.js for Windows package (currently 0.4.2) downloaded from here:
It works great – I can install packages with npm, and run packages like node-inspector, express, etc. The problem is that I can only run those packages if I’m in the bin directory of the distro. I run the setenv.cmd file, which adds bin to the path, but attempting to actually invoke a package (like install another package using npm) when I’m not in the bin path results in the following exception.
Error: Cannot find module '/npm ' at Function._resolveFilename (module.js:299:11) at Function._load (module.js:245:25) at Array.<anonymous> (module.js:402:10) at EventEmitter._tickCallback (node.js:108:26)
I’ve tried setting the NODE_PATH environment variable to my node package dir, but that doesn’t. help.