Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember CLI Crash on Rebuild after Clean install -- What am i doing wrong?

I have no idea what's wrong but when i change a file in my project, which triggers a rebuild, I get an EEXIST, file already exists error with a reference to a tmp file location.

To illustrate please see the following:

1) I start from a clean slate as instructed by Ember's release notes:

➜  code  npm uninstall -g ember-cli
unbuild [email protected]
➜  code  npm cache clean
➜  code  bower cache clean
bower deleted       Cached package ember: /Users/userx/.cache/bower/packages/6c52274ebac940c836cec79e11a2d66a/1.10.0
bower deleted       Cached package ember-cli-test-loader: /Users/userx/.cache/bower/packages/fe70ed35683979c3b9a86502abc892c8/0.1.3
bower deleted       Cached package ember-load-initializers: /Users/userx/.cache/bower/packages/ace05fe526bc815d00157b3e7fdcccab/0.0.2
bower deleted       Cached package ember-qunit: /Users/userx/.cache/bower/packages/6b2637f1e3c33e331968889fd7088678/0.2.8
bower deleted       Cached package ember-qunit-notifications: /Users/userx/.cache/bower/packages/ebaf09c3e2e50cee4fa08625051f7d60/0.0.7
bower deleted       Cached package ember-data: /Users/userx/.cache/bower/packages/b56c7ee7b1cb5f358555b733f3ec15c1/1.0.0-beta.15
bower deleted       Cached package ember-cli-shims: /Users/userx/.cache/bower/packages/b2aa621bf259c52274bc62a524406e11/0.0.3
bower deleted       Cached package loader.js: /Users/userx/.cache/bower/packages/b765bce6e48383520b38bc3732776d8e/1.0.1
bower deleted       Cached package qunit-notifications: /Users/userx/.cache/bower/packages/cb84eb840aaebd3c38265d13fc3e2e70/0.0.6
bower deleted       Cached package ember-resolver: /Users/userx/.cache/bower/packages/93ca6e97b9b9d8c72c8101fc00862583/0.1.12
bower deleted       Cached package qunit: /Users/userx/.cache/bower/packages/db7350f12693d26675a7426499405707/1.17.1
bower deleted       Cached package jquery: /Users/userx/.cache/bower/packages/fe2fe255e91d251051d543998aa8327a/1.11.2
bower deleted       Cached package jquery: /Users/userx/.cache/bower/packages/fe2fe255e91d251051d543998aa8327a/2.1.3

2) Install Ember CLI 0.2.0-beta.1

➜  code  npm install -g [email protected]
/usr/local/bin/ember -> /usr/local/lib/node_modules/ember-cli/bin/ember
[email protected] /usr/local/lib/node_modules/ember-cli
├── [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])
├── [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])
├── [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], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

3) Prove to myself Ember/node/npm are all good

➜  code  ember version
version: 0.2.0-beta.1
node: 0.12.0
npm: 2.1.8

4) Create a brand new Ember app

➜  code  ember new an-app
version: 0.2.0-beta.1
installing
  create .bowerrc
  create .editorconfig
  create .ember-cli
  create .jshintrc
  create .travis.yml
  create Brocfile.js
  create README.md
  create app/app.js
  create app/components/.gitkeep
  create app/controllers/.gitkeep
  create app/helpers/.gitkeep
  create app/index.html
  create app/models/.gitkeep
  create app/router.js
  create app/routes/.gitkeep
  create app/styles/app.css
  create app/templates/application.hbs
  create app/templates/components/.gitkeep
  create app/views/.gitkeep
  create bower.json
  create config/environment.js
  create .gitignore
  create package.json
  create public/crossdomain.xml
  create public/robots.txt
  create testem.json
  create tests/.jshintrc
  create tests/helpers/resolver.js
  create tests/helpers/start-app.js
  create tests/index.html
  create tests/test-helper.js
  create tests/unit/.gitkeep
  create vendor/.gitkeep
Installed packages for tooling via npm.
Installed browser packages via Bower.
Successfully initialized git.

5) Start up the app

➜  code  cd an-app
➜  an-app git:(master) ember server
version: 0.2.0-beta.1
Livereload server on port 35729
Serving on http://0.0.0.0:4200/

Build successful - 3682ms.

Slowest Trees                  | Total
-------------------------------+----------------
Concat: Vendor                 | 3046ms

6) Save an unmodified router.js which will trigger a rebuild. This is where things crash.

file changed router.js
EEXIST, file already exists '/Users/userx/code/an-app/tmp/caching-writer-dest-dir_4SJKQT.tmp'
Error: EEXIST, file already exists '/Users/userx/code/an-app/tmp/caching-writer-dest-dir_4SJKQT.tmp'
    at Error (native)
    at Object.fs.symlinkSync (fs.js:852:18)
    at symlink (/Users/userx/code/an-app/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
    at Function.symlinkOrCopySync (/Users/userx/code/an-app/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
    at /Users/userx/code/an-app/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
    at lib$rsvp$$internal$$tryCatch (/Users/userx/code/an-app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/userx/code/an-app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
    at lib$rsvp$$internal$$publish (/Users/userx/code/an-app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
    at lib$rsvp$asap$$flush (/Users/userx/code/an-app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
    at process._tickCallback (node.js:355:11)

I really have no idea how / where to start debugging this. I have tried the previous version of node, io.js and removing/reinstalling watcher. All have failed.

Thank you for your time.

like image 788
SharkLaser Avatar asked Mar 04 '15 03:03

SharkLaser


1 Answers

The Ember CLI community found a fix for this issue overnight. You can view the discussion at the following link: https://github.com/ember-cli/ember-cli/issues/3413

The long and short of it: modify your package.json file to include "broccoli-sass": "^0.4.0" under devDependencies, and "rimraf":"2.2.8" under your listed dependencies.

I can confirm that if you make these changes, then delete /node_modules, /bower_components, and /tmp, then perform npm install and bower install, then run ember server, your project will auto-update correctly when a file changes.

Just don't ask me why.

like image 115
StickByAtlas Avatar answered Oct 28 '22 21:10

StickByAtlas