angular-cli: BroccoliTypscriptCompiler error during ng serve

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.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 31 (4 by maintainers)

Commits related to this issue

Most upvoted comments

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.

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

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

Great ! thanks @victorazevedo

“RUN git bash as ADMINISTRATOR than problem solved”

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

Same issue here with the latest angular-cli

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 problem on WINDOWS…RUN git bash as ADMINISTRATOR than problem solved

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