#37013: Not require node.js modules, installed globaly via npm ---------------------------+------------------------- Reporter: darkvlados@… | Owner: ciserlohn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: invalid | Keywords: Port: npm | ---------------------------+------------------------- Changes (by ryandesign@…): * status: new => closed * cc: ryandesign@… (added) * resolution: => invalid Old description:
If I use require('some_module_installed_global') in my node.js projects, then: Error: Cannot find module 'some_module_installed_global'
Which modules install in /opt/local/lib/node_modules/, but $NODE_PATH not properly sets.
New description: If I use require('some_module_installed_global') in my node.js projects, then: {{{ Error: Cannot find module 'some_module_installed_global' }}} Which modules install in /opt/local/lib/node_modules/, but $NODE_PATH not properly sets. -- Comment: This sounds like not a MacPorts problem but a question of how nodejs and npm work. If you want to require() something in your project, then you're supposed to `npm install` the module locally, not globally, or else use `npm link`. Ask in a nodejs support venue if you have further questions. -- Ticket URL: <https://trac.macports.org/ticket/37013#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS