Skip to content


closurebuilder problem with grunt build #22

zemd opened this Issue · 5 comments

2 participants


There is an error ''IOError: [Errno 2] No such file or directory: 'temp/compiled.js'' during building source code.
This happens in this grunt task:

app: {
  src: [
  dest: 'temp/compiled.js'

if I create 'temp' folder, after running task it get removed.

Had made quick fix for for this

if options.output_file:
    output_dir = os.path.dirname(options.output_file)
    if not os.path.exists(output_dir):
    out = open(options.output_file, 'w+')
    out = sys.stdout

but I think this is not an closurebuilder's issue.


I could not reproduce the problem... if the issue persists i'd have to have a closer look at either the Grunt Closure Tools or Grunt itself...

What OS are you on? Please provide full environment info if the issue persists.


windows 8 x64
Python 2.7.5
node v0.10.24
npm 1.3.22


nice, please help me debug, paste me the result of the following command:

grunt build --stack --debug
D:\proj>grunt build --stack --debug
Running "clean:dist" (clean) task
[D] Task source: D:\proj\node_modules\grunt-contrib-clean\tasks\clean.js
Cleaning temp...OK

Running "uglify:vendor" (uglify) task
[D] Task source: D:\proj\node_modules\grunt-contrib-uglify\tasks\uglify.js
>> Destination (temp/vendor.js) not written because src files were empty.

Running "closureBuilder:app" (closureBuilder) task
[D] Task source: D:\proj\node_modules\grunt-closure-tools\tasks\closureTools.js
Executing: python app/closure-library/closure/bin/build/  -i app/js/main.js --root=app/js/ --root=app/closure-library --root=app/components -o compiled --output_file=temp/compiled.js --compiler_jar=node_modules/superstartup-closure-compiler/build/sscompiler.jar --compiler_flags="--compilation_level=ADVANCED_OPTIMIZATIONS" --compiler_flags="--define='goog.DEBUG=false'" --compiler_flags="--warning_level=verbose" --compiler_flags="--jscomp_off=checkTypes" --compiler_flags="--jscomp_off=fileoverviewTags" --compiler_flags="--summary_detail_level=3" --compiler_flags="--only_closure_dependencies" --compiler_flags="--closure_entry_point=myapp" --compiler_flags="--create_source_map=app/jsc/" --compiler_flags="--source_map_format=V3" --compiler_flags="--output_wrapper=(function(){%output%}).call(this);"
>> Error: Command failed: Traceback (most recent call last):
>>   File "app/closure-library/closure/bin/build/", line 268, in <module>
>>     main()
>>   File "app/closure-library/closure/bin/build/", line 197, in main
>>     out = open(options.output_file, 'w+')
>> IOError: [Errno 2] No such file or directory: 'temp/compiled.js'
>> FAILED to run command for target: app
Warning: Task "closureBuilder:app" failed. Use --force to continue.
Error: Task "closureBuilder:app" failed.
    at Task.<anonymous> (D:\proj\node_modules\grunt\lib\util\task.js:197:15)
    at null._onTimeout (D:\proj\node_modules\grunt\lib\util\task.js:225:33)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Aborted due to warnings.
@thanpolas thanpolas closed this in 40e5bec

@hunterman fixed, generator will now create the temp/ folder for you, v0.1.13 is on npm.

You experienced an edge case were you removed all vendor files so Grunt did not have a chance to create the temp/ folder before closureBuilder was run...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.