3

Getting the following:

Uncaught Error: Cannot find module 'C:\Users\SR71042\AppData\Roaming\npm\node_modules\browserify\node_modules\insert-module-globals\node_modules\process\browser.js' 

Anyone has an idea? The module is indeed there.

EDIT:

It only happens if I require a jison parser. http://zaach.github.io/jison/try/, using:

parser = require('./calculator').parser

This is how jison does the export part:

if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
    exports.parser = parser;
    exports.Parser = parser.Parser;
    exports.parse = function () {
        return parser.parse.apply(parser, arguments);
    };
    exports.main = function commonjsMain(args){
        if(!args[1]){
            console.log("Usage: "+args[0]+" FILE");
            process.exit(1)
        }
        var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");
        return exports.parser.parse(source)
    };
    if (typeof module !== 'undefined' && require.main === module) {
        exports.main(process.argv.slice(1));
    }
}
3
  • 1
    Can you give any more details? What call is causing this error? Commented Feb 10, 2014 at 19:11
  • Just adding it as a script to my index.html Commented Feb 10, 2014 at 19:14
  • @cpburnz added some more info Commented Feb 10, 2014 at 19:24

1 Answer 1

1

Solved by replacing that mindfuck exports part with a exports.parser = parser;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.