Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: MODULE_NOT_FOUND for required modules #134

Closed
craigshoemaker opened this issue May 15, 2015 · 1 comment
Closed

Error: MODULE_NOT_FOUND for required modules #134

craigshoemaker opened this issue May 15, 2015 · 1 comment

Comments

@craigshoemaker
Copy link

When I run my application during development using the following command:

nw.exe .

...everything works as expected and when I open the developer tools I see this:

image

However, when I attempt to run the application after running grunt-node-webkit-builder, I get the following errors:

image

I understand that some modules that use C/C++ addons may require a rebuild, but that's certainly not the case for lodash and humanize-plus.

I have made my code available in this repository so you can see what I am doing. For quick reference, this is all the script is attempting to do:

(function () {

    var attemptRequire = function(moduleName){
        try {
            var mod = require(moduleName);
            console.log(moduleName + ' loaded');
        } catch (ex){
            console.log(ex);
        }
    };

    attemptRequire('underscore');
    attemptRequire('lodash');
    attemptRequire('humanize-plus');
    attemptRequire('fs');
    attemptRequire('fs-extra');
    attemptRequire('node-webkit-fdialogs');

}());

Any insight you can offer is appreciated.

@adam-lynch
Copy link
Contributor

Sorry for taking so long to get to this. Those modules would exist in /node_modules but you don't tell grunt-nw-builder to put node_modules in your app. See https://github.com/craigshoemaker/grunt-node-webkit-builder-test/blob/master/gruntfile.js#L12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants