Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running 'ember server' causes builds to fail with an EEXIST error?

Got this random build error while running ember server today. Before you ask, here are my Ember CLI, Node and NPM versions:

version: 0.1.15
node: 0.10.33
npm: 2.1.8

I created a new Ember project using ember new [app name]. Everything worked. I then ran ember server, fired up the page on http://localhost:4200/ and the page showed. I then created a new route called index using ember generate route index. As always, Ember CLI created the route, the Handlebars file and a matching test.js. Immediately after this, the running Ember server process threw a build error:

file changed templates/index.hbs
EEXIST, file already exists '/Users/Nagarjun/Code/RideBazaar/web-client/tmp/class-tmp_cache_dir-hBTLOW8N.tmp'
Error: EEXIST, file already exists '/Users/Nagarjun/Code/RideBazaar/web-client/tmp/class-tmp_cache_dir-hBTLOW8N.tmp'
    at Object.fs.symlinkSync (fs.js:741:18)
    at symlink (/Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
    at Function.symlinkOrCopySync [as sync] (/Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
    at /Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
    at lib$rsvp$$internal$$tryCatch (/Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
    at lib$rsvp$$internal$$publish (/Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
    at Object.lib$rsvp$asap$$flush [as _onImmediate] (/Users/Nagarjun/Code/RideBazaar/web-client/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
    at processImmediate [as _immediateCallback] (timers.js:345:15)

Strangely, when I hit ctrl c, stop the server and re-start it, the build is successful. However, when I make a change to the file again, I get the same error. Any clues?

like image 375
JackH Avatar asked Mar 04 '15 11:03

JackH


1 Answers

Looks like a bug which has been logged against the ember-cli project (GitHub Issue #3413)

I managed to fix it by following the instructions in GitHub Issue #3413. To fix the issue:

  1. Add "rimraf":"2.2.8" to your package.json file (in the devDependencies section - below "glob": "^4.0.5")
  2. Remove the node_modules directory (e.g. on Mac or Linux, execute rm -rf ./node_modules)
  3. Run npm install again
like image 83
jmurphyau Avatar answered Oct 23 '22 07:10

jmurphyau