Angular-cli: BroccoliTypscriptCompiler error during ng serve

Created on 7 Apr 2016  路  31Comments  路  Source: angular/angular-cli

Running ng serve and making a change to a file gives me the following error:

The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: EEXIST: file already exists, link '/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/tmp/broccoli_type_script_compiler-cache_path-g6eAeTvI.tmp/src/client/app/contact-header/contact-header.js.map' -> '/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/tmp/broccoli_type_script_compiler-output_path-z1rCCzws.tmp/src/client/app/contact-header/contact-header.js.map'
    at Error (native)
    at Object.fs.linkSync (fs.js:918:18)
    at BroccoliTypeScriptCompiler._outputFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:205:8)
    at Object.writeFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:163:14)
    at Object.writeFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:6515:14)
    at writeEmittedFiles (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:32726:24)
    at doEmit (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:32594:17)
    at emitFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:39322:17)
    at onSingleFileEmit (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:6483:13)
    at Object.forEachExpectedEmitFile (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/typescript/lib/typescript.js:6457:21)

The broccoli plugin was instantiated at: 
    at BroccoliTypeScriptCompiler.Plugin (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/index.js:10:31)
    at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/broccoli-caching-writer/index.js:21:10)
    at BroccoliTypeScriptCompiler (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:26:10)
    at Angular2App.toTree.Angular2App._getTsTree (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/angular2-app.js:249:16)
    at Angular2App.toTree (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/lib/broccoli/angular2-app.js:37:21)
    at module.exports (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/angular-cli-build.js:14:14)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/Users/pascalprecht/projects/thoughtram/angular2-master-class-solutions/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)

This error does not occur when I kill the serve process and start it again.

bufix

Most helpful comment

I was having the same problem in windows with beta 1 until I ran my command line as administrator. I'm assuming if you're haveing the problem under linux or osx you can run it as sudo and it would fix it.

All 31 comments

I should add that this only appears when ng serve threw a TS compiler error anyway.

So when there's a TS error, and I fix it, I get the error mentioned above

Also for me. @hansl is aware of that issue.

I am having the same issue except the error is still persisting after attempting to serve again

`file changed app.ts
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: EEXIST: file already exists, link '/Users/JeremyP/Desktop/sleepdiary/tmp/broccoli_type_script_compiler-cache_path-v690MQVD.tmp/src/app/entry/entry.service.js.map' -> '/Users/JeremyP/Desktop/sleepdiary/tmp/broccoli_type_script_compiler-output_path-DvdvYPCa.tmp/src/app/entry/entry.service.js.map'
at Error (native)
at Object.fs.linkSync (fs.js:966:18)
at BroccoliTypeScriptCompiler._outputFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:205:8)
at Object.writeFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:163:14)
at Object.writeFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:6515:14)
at writeEmittedFiles (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:32726:24)
at doEmit (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:32594:17)
at emitFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:39322:17)
at onSingleFileEmit (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:6483:13)
at Object.forEachExpectedEmitFile (/Users/JeremyP/Desktop/sleepdiary/node_modules/typescript/lib/typescript.js:6457:21)

The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (/Users/JeremyP/Desktop/sleepdiary/node_modules/broccoli-plugin/index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter as constructor
at BroccoliTypeScriptCompiler (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:25:35)
at Angular2App.toTree.Angular2App._getTsTree (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/angular2-app.js:249:16)
at Angular2App.toTree (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/broccoli/angular2-app.js:37:21)
at module.exports (/Users/JeremyP/Desktop/sleepdiary/angular-cli-build.js:9:14)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/Users/JeremyP/Desktop/sleepdiary/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/Users/JeremyP/Desktop/sleepdiary/node_modules/angular-cli/lib/tasks/serve.js:15:19)

`

I'm getting the same behavior upon fixing a bug, except I get:

Error: Trying to add a new entry to an already existing one:

I have an open stackoverflow question with more details. Resetting the server does work for me.

Here is the full error text:

[file changed app/vtClass.ts
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Trying to add a new entry to an already existing one: /home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-hVpXnhDr.tmp/0/src/app/ang2-cli2.spec.ts
    at BroccoliTypeScriptCompiler._addNewFileEntry (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:215:13)
    at /home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:159:38
    at Array.forEach (native)
    at BroccoliTypeScriptCompiler._doFullBuild (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:159:16)
    at BroccoliTypeScriptCompiler._doIncrementalBuild (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:116:12)
    at BroccoliTypeScriptCompiler.build (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:45:12)
    at /home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/broccoli-caching-writer/index.js:152:21
    at lib$rsvp$$internal$$tryCatch (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1019:11)

The broccoli plugin was instantiated at: 
    at BroccoliTypeScriptCompiler.Plugin (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/broccoli-plugin/index.js:10:31)
    at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/broccoli-caching-writer/index.js:21:10)
    at BroccoliTypeScriptCompiler (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:25:35)
    at Angular2App.toTree (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/angular2-app.js:67:16)
    at module.exports (/home/vturner/vtstuff/angular/projects/ang2-cli2/angular-cli-build.js:14:14)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)
    at /home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/commands/serve.js:70:22](url)

A problem deleting old files like this prior ticket?

I upgraded to watchman as recommended under the ember-cli web site to see if this would fix the problem. Unfortunately, it did not.

So the problem happens with _NodeWatcher_ and _Watchman_.

I also tried the emacs lockfile fixes as recommended under the ember-cli site, but no effect here either.

I am running Linux mint 17.3.

The problem is also reproducible for me under windows 10.

Since this problem was _really_ bugging me -- to the point where I just couldn't work with angular-cli anymore, I just looked at the stack trace and basically zapped the code to ignore these problems. I've been using it for several hours now, and everything seems to work fine. I would think a real fix would be about figuring out why it's trying to use duplicate files, but here's what I did anyway:

1) edit module
node_modules/angular-cli/lib/broccoli/broccoli-typescript.js

2) edit method _addNewFileEntry like so (altered code marked by my initials 'vt'):

 _addNewFileEntry(entry) {
    const p = path.join(this.inputPaths[0], entry.relativePath);
    if (this._fileRegistry[p]) {
      //vt add
      console.log("vt.broccoli-typescript.js: intercepting dupicate entry error for" + p);
      //vt end
      //vtthrow new Error('Trying to add a new entry to an already existing one: ' + p);
    }

3) edit method _outputFile:

_outputFile(absoluteFilePath, fileContent, registry) {
absoluteFilePath = path.resolve(this.cachePath, absoluteFilePath);
// Replace the input path by the output.
absoluteFilePath = absoluteFilePath.replace(this.inputPaths[0], this.cachePath);
const outputFilePath = absoluteFilePath.replace(this.cachePath, this.outputPath);

if (registry) {
  registry.outputs.add(absoluteFilePath);
}

fse.mkdirsSync(path.dirname(absoluteFilePath));
const content = this.fixSourceMapSources(fileContent);
fs.writeFileSync(absoluteFilePath, content, FS_OPTS);

//vt add
try {
//vt end
  fse.mkdirsSync(path.dirname(outputFilePath));
  fs.linkSync(absoluteFilePath, outputFilePath);
//vt add
}
catch (e) {
  console.log('_outputFile: caught error ' + e);
}
//vt end
}

A full output log now looks like:

    file changed app/vtClass.ts
--> Initial Error:
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
  /home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app/vtClass.ts (22,28): Cannot find module './webvr-manager'.
    at BroccoliTypeScriptCompiler._doIncrementalBuild (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:112:19)
    at BroccoliTypeScriptCompiler.build (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:45:12)
    at /home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/broccoli-caching-writer/index.js:152:21
    at lib$rsvp$$internal$$tryCatch (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/rsvp/dist/rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at: 
    at BroccoliTypeScriptCompiler.Plugin (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/broccoli-plugin/index.js:10:31)
    at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/broccoli-caching-writer/index.js:21:10)
    at BroccoliTypeScriptCompiler (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:25:35)
    at Angular2App.toTree (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/lib/broccoli/angular2-app.js:67:16)
    at module.exports (/home/vturner/vtstuff/angular/projects/ang2-cli2/angular-cli-build.js:14:14)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)
    at /home/vturner/vtstuff/angular/projects/ang2-cli2/node_modules/angular-cli/node_modules/angular-cli/lib/commands/serve.js:70:22

--> addNewFileEntry errors
file changed app/vtClass.ts
file changed app/vtClass.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app/ang2-cli2.spec.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app/ang2-cli2.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app/route-config.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app/vtClass.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app/vtInterface.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/app.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/src/typings.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/angular-protractor/angular-protractor.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/es6-shim/es6-shim.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/jasmine/jasmine.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/selenium-webdriver/selenium-webdriver.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/three/index.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/three-vrcontrols/index.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/three-vreffect/index.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/ambient/webvr-boilerplate/index.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser/definitions/webvr-boilerplate/index.d.ts
vt.broccoli-typescript.js: intercepting dupicate entry error for/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-input_base_path-01oP2v39.tmp/0/typings/browser.d.ts

-->_outputFIle errors:
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/route-config.js.map' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/route-config.js.map'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/route-config.js' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/route-config.js'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/vtClass.js.map' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/vtClass.js.map'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/vtClass.js' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/vtClass.js'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/ang2-cli2.js.map' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/ang2-cli2.js.map'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/ang2-cli2.js' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/ang2-cli2.js'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app.js.map' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app.js.map'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app.js' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app.js'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/ang2-cli2.spec.js.map' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/ang2-cli2.spec.js.map'
_outputFile: caught error Error: EEXIST: file already exists, link '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-cache_path-TR5DIkaE.tmp/src/app/ang2-cli2.spec.js' -> '/home/vturner/vtstuff/angular/projects/ang2-cli2/tmp/broccoli_type_script_compiler-output_path-ccx0ICfu.tmp/src/app/ang2-cli2.spec.js'

Build successful - 4295ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
BroccoliTypeScriptCompiler                    | 3986ms              

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
BroccoliTypeScriptCompiler (1)                | 3986ms              

Note the Build Successful message at the end, instead of having to hit Ctrl-C and cycle the server. Once you get the condition, you always seem to get it e.g it seems to keep using the same tmp files over and over (?)

@vt5491 thanks for this, but IMO this is complex enough to let @hansl do the work. He rewrote the whole broccoli-typescript.js about a week ago and knows how things are in compiler. Since there's a really lousy docs about TS compiler or even not existent please wait, I think the patch is coming soon.

That's good news. Looking forward to the official patch.

Same error with angular-cli v1.0.0-beta 1.
Did I miss some fixes? Can't find any solution.

Only solution ist to downgrade?????

Same issue here with the latest angular-cli

It's still not working

I was having the same problem in windows with beta 1 until I ran my command line as administrator. I'm assuming if you're haveing the problem under linux or osx you can run it as sudo and it would fix it.

Exactly like @TheOriginalJosh : just run the command line as an administrator and the ng serve does run well. Thanks !

@TheOriginalJosh @aboudard it works quit well with run as administrator. Thanks :)

running as administrator within WebStorm > fresh cli-setup > ng serve:
(WebStorm 2016.2 EAP, JRE: 1.8.0_66-b17 amd64
angular-cli: 1.0.0-beta.6 | node: 5.11.1 | npm: 3.10.2 | os: win32 x64)

Build error

The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
  C:/whatever/__FE/TESTAREA/Multi2/tmp/broccoli_type_script_compiler-input_base_path-39ULm7Nz.tmp/0/src/multi2.routes.ts (7, 3): ',' expected.
  C:/whatever/__FE/TESTAREA/Multi2/tmp/broccoli_type_script_compiler-input_base_path-39ULm7Nz.tmp/0/src/multi2.routes.ts (3, 33): Cannot find module './'.
    at BroccoliTypeScriptCompiler._doIncrementalBuild (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:120:19)
    at BroccoliTypeScriptCompiler.build (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:43:10)
    at C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:152:21
    at lib$rsvp$$internal$$tryCatch (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at: 
    at BroccoliTypeScriptCompiler.Plugin (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\broccoli-plugin\index.js:10:31)
    at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:21:10)
    at BroccoliTypeScriptCompiler (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:26:49)
    at Angular2App._getTsTree (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\lib\broccoli\angular2-app.js:321:18)
    at Angular2App._buildTree (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\lib\broccoli\angular2-app.js:116:23)
    at new Angular2App (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\lib\broccoli\angular2-app.js:53:23)
    at module.exports (C:\whatever\__FE\TESTAREA\Multi2\angular-cli-build.js:10:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\ember-cli\lib\models\builder.js:55:19)
    at Class.module.exports.Task.extend.init (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\ember-cli\lib\models\builder.js:89:10)
    at new Class (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\core-object\core-object.js:18:12)
    at Class.module.exports.Task.extend.run (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\ember-cli\lib\tasks\serve.js:15:19)
    at C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\ember-cli\lib\commands\serve.js:64:24
    at lib$rsvp$$internal$$tryCatch (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (C:\whatever\__FE\TESTAREA\Multi2\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)

+1 with cli beta.9 & angular2 rc.4

+1 with cli beta.9 & angular2 rc.4

+1 with cli beta.9 & angular2 rc.4

I had same weird problem with Angular-cli 1.0.0-beta.10 & Angular2 RC4

Does that happens when you delete some of the source file?

Check if this is repro in .11 version

I found my problem. (It was not same problem as in this topic. Sorry.)

When i add a parameter to constructor in my component (member.component.ts) i didn't update test file (member.component.spec.ts) manually. And i got error from tmp folder like below:

.../tmp/broccoli_type_script_compiler-input_base_path-gSIkus6k.tmp/0/src/app/mng/mng.component.spec.ts (10, 21): Supplied parameters do not match any signature of call target.

When i deleted/commented describe section in member.component.spec.ts, it was builded normally and error has gone.

So if you see an error about spec.ts and parameters, think about test file. Weird one is error does not tell about exact file.

I am using following versions

+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | |-- [email protected]
| | -- [email protected] | |-- [email protected]
| +-- [email protected]
| | -- [email protected] |-- [email protected]
| -- [email protected] -- [email protected]
`-- [email protected]

My app was working fine once I close the cmd and start again, I am getting below errors :

`
C:Users\Chandra\Desktop\angi\a2todos>ng serve
(node:1940) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
C:/Users/Chandra/Desktop/angi/a2todos/tmp/broccoli_type_script_compiler-input_base_path-WD7fUJ9p.tmp/0/src/app/todos/todos.component.spec.ts (10, 21): Supplied parameters do not match any signature of call target.
at BroccoliTypeScriptCompiler._doIncrementalBuild (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-cli\lib\broccolibroccoli-typescript.js:120:19)
at BroccoliTypeScriptCompiler.build (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-cli\lib\broccolibroccoli-typescript.js:43:10)
at C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\broccoli-caching-writer\index.js:152:21
at lib$rsvp$$internal$$tryCatch (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\broccoli-plugin\index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter as constructor
at BroccoliTypeScriptCompiler (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-cli\lib\broccolibroccoli-typescript.js:27:5)
at Angular2App._getTsTree (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-cli\lib\broccoli\angular2-app.js:331:18)
at Angular2App._buildTree (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-cli\lib\broccoli\angular2-app.js:124:23)
at new Angular2App (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-cli\lib\broccoli\angular2-app.js:53:23)
at module.exports (C:Users\Chandra\Desktop\angi\a2todos\angular-cli-build.js:10:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\angular-cli\lib\models\builder.js:55:19)
at Class.module.exports.Task.extend.init (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\angular-cli\lib\models\builder.js:89:10)
at new Class (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\core-object\core-object.js:18:12)
at Class.module.exports.Task.extend.run (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\angular-cli\lib\tasksserve.js:15:19)
at C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\angular-cli\lib\commandsserve.js:64:24
at lib$rsvp$$internal$$tryCatch (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (C:Users\Chandra\Desktop\angi\a2todosnode_modules\angular-clinode_modules\rsvp\dist\rsvp.js:1198:9)

`

If you comment some code in the todos.component.spec.ts, this error will disappear.
Try to do it:

/* let component = new TestComponent();
expect(component).toBeTruthy() */

I know that I will need it for unit test, and I don't know how to solve it.
It's not a good solution.

+1

Running into a similar issue with all spec files generated with angular-cli 1.0.0-beta.10 & Angular2 RC4 (or 5). For me 'ng serve' works fine, but 'ng build -prod' does not, and fails with:

The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
  S:/projects/fox1/ui/src/angular/web-application/tmp/broccoli_type_script_compiler-input_base_path-dQOJLOas.tmp/0/src/app/shared/component-outlet.directive.spec.ts (8, 21): Supplied parameters do not match any signature of call target.

In the code, the keywords describe, it and expect are all underlined with message "Cannot find name 'describe'" for example.

Renaming or removing the spec files fixes it, but it would be nice to be able to try out unit tests too. Any ideas would be appreciated. Thanks!

same problem on WINDOWS...RUN git bash as ADMINISTRATOR than problem solved

Great ! thanks @victorazevedo

"RUN git bash as ADMINISTRATOR than problem solved"

@TheOriginalJosh worked like a treat. Thanks :)

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings