I have installed requirejs globally, but node says it can't find it.
# node tools/mapconv.js
module.js:340
throw err;
^
Error: Cannot find module 'requirejs'
...
# cat mapconv.js
var requirejs = require('requirejs');
...
The module is definitely installed:
# npm ls -g | grep requirejs
├── requirejs@2.1.6
I have cleared the NPM cache, but no change. Has anyone else run into this?
Thanks.
Make sure your NODE_PATH environment variable is set. To find out where to set it to, run:
npm install --global --verbose requirejs
set node path to the dir ending in node_modules