thanpolas / grunt-closure-tools

Google Closure Tools for grunt
MIT License
95 stars 22 forks source link

FAILED to run command for target: development #42

Closed pvouzis closed 10 years ago

pvouzis commented 11 years ago
 I have the following script:   

 closureBuilder:  {
        options: {
            // [REQUIRED] To find the builder executable we need either the path to
            //    closure library or directly the filepath to the builder:
            closureLibraryPath: 'closure-library', // path to closure library
            // [OPTIONAL] You can define an alternative path of the builder.
            //    If set it trumps 'closureLibraryPath' which will not be required.
           //builder: 'path/to/closurebuilder.py',

            // [REQUIRED] One of the two following options is required:
            //inputs: 'string|Array', // input files (can just be the entry point)
            inputs: 'server.js', // input files (can just be the entry point)
           //namespaces: 'string|Array', // namespaces

            // [OPTIONAL] The location of the compiler.jar
            // This is required if you set the option "compile" to true.
            compilerFile: 'compiler.jar',

            // [OPTIONAL] output_mode can be 'list', 'script' or 'compiled'.
            //    If compile is set to true, 'compiled' mode is enforced.
            //    Default is 'script'.
            output_mode: 'script',

            // [OPTIONAL] if we want builder to perform compile
            compile: false, // boolean

            compilerOpts: {
                /**
                 * Go wild here...
                 * any key will be used as an option for the compiler
                 * value can be a string or an array
                 * If no value is required use null
                 */
            },
            // [OPTIONAL] Set exec method options
            execOpts: {
                /**
                 * Set maxBuffer if you got message "Error: maxBuffer exceeded."
                 * Node default: 200*1024
                 */
                maxBuffer: 999999 * 1024
            }

        },

        // any name that describes your operation
        development: {

            // [REQUIRED] paths to be traversed to build the dependencies
            //              src: 'string|Array',

            // [OPTIONAL] if not set, will output to stdout
            //              dest: ''
            src: ['./', 'lib'],
           //src: '.',
            dest: 'dist/<%= pkg.name %>.js'
        }
    }

and I get the following error:

grunt closure --stack Running "closureBuilder:development" (closureBuilder) task Executing: python closure-library/closure/bin/build/closurebuilder.py -i server.js --root=./ --root=lib -o script --output_file=dist/nbmsgsrv.js

Error: Command failed: closure-library/closure/bin/build/closurebuilder.py: Scanning paths... closure-library/closure/bin/build/closurebuilder.py: 4228 sources scanned. closure-library/closure/bin/build/closurebuilder.py: Building dependency tree.. Traceback (most recent call last): File "closure-library/closure/bin/build/closurebuilder.py", line 262, in main() File "closure-library/closure/bin/build/closurebuilder.py", line 211, in main tree = depstree.DepsTree(sources) File "/var/www/dev_panos/nb-ui/msgsrv/closure-library/closure/bin/build/depstree.py", line 48, in init provide, [self._provides_map[provide], source]) depstree.MultipleProvideError: Namespace "Todos.models.Todo" provided more than once in sources: Source node_modules/grunt-closure-tools/test/case/js/app/models/todo.js Source node_modules/grunt-closure-tools/test/expected/build.bundled.js FAILED to run command for target: development Warning: Task "closureBuilder:development" failed. Use --force to continue. Error: Task "closureBuilder:development" failed. at Task. (/var/www/dev_panos/nb-ui/msgsrv/node_modules/grunt/lib/util/task.js:197:15) at null._onTimeout (/var/www/dev_panos/nb-ui/msgsrv/node_modules/grunt/lib/util/task.js:225:33) at Timer.listOnTimeout as ontimeout

Aborted due to warnings.

Can you help please?

Best, Panos

thanpolas commented 11 years ago

Panos the error is pretty straightforward and common:

depstree.MultipleProvideError: Namespace "Todos.models.Todo" provided more than once in sources:

Which means what is says, you have two declarations of goog.provide('Todos.models.Todo'); in your codebase...

Are you trying to compile the Mantri showcase or the Todos project out of the box? Is your project on a public repo i can have a look?

thanpolas commented 10 years ago

Closed due to innactivity