Question

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));
    }
}
Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top