1

I'm trying to get an existing ember app running locally for development, but when I run "ember server" from inside the app directory, I get this error:

version: 0.0.39
Livereload server on port 35729
Serving on http://0.0.0.0:4200
EACCES, unlink 'dist/assets/.gitkeep'
Error: EACCES, unlink 'dist/assets/.gitkeep'

Per this thread https://github.com/stefanpenner/ember-cli/issues/381 I tried doing the following:

npm uninstall -g ember-cli 
rm -rf node_modules
npm cache clear
npm install -g ember-cli
npm install
bower install

Note however I had to use sudo in front of all the npm commands as well as rm -rf node_modules. I also tried per this thread https://github.com/bower/bower/issues/475 and again using sudo:

npm cache clean
npm uninstall -g bower
npm install -g bower

but none of this worked, I still get the same error. I'm new to using all this Ember tooling i.e. npm, bower, ember-cli, etc. and have a feeling I did something wrong during the install process if I'm having to use sudo all the time. Suggestions for how to fix that error?

chris
  • 71
  • 7

4 Answers4

1

Ok, I had the same issue and the way to fix is is the following. In your command line (assuming a unix-like system):

Add owner permission to npm: sudo chown -R $(whoami) ~/.npm

Now, if bower is also causing you issues, the way to solve this is to clear the bower cache (as suggested by @torazaburo):

bower cache clear

Or you can do it manually:

cd ~/.cache/bower # navigate to the bower cache directory
rm -rf packages   # delete packages directory and its content
rm -rf registry   # delete registry directory and its content

Hope this helps ...

nem035
  • 31,501
  • 5
  • 73
  • 88
0

try to remove all node_modules (global) not only from project directory. if you use some version manager like nvm they must be in .nvm dir.

Stakoov
  • 196
  • 5
  • I tried removing everything mentioned in the answer to [this question] (http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x/11178106#11178106) however I'm unable to reinstall node without using their installer. I tried the installer and it worked, but then sudo was required for installing and running other tools, which may have led me to this problem of ember server not working. When I try installing node with nvm or homebrew, both methods fail with errors. Should I elaborate by editing my original question? – chris Sep 11 '14 at 17:19
0

The thing that worked for me was running ember server with sudo

sudo ember server

pjcarly
  • 416
  • 3
  • 12
0

This is just a guess: Did you install npm through homebrew? I heard that this can cause problems and forces you to use sudo a lot (https://gist.github.com/DanHerbert/9520689). Should this be the cause of your problem, an alternative for installing npm could be to brew install nvm and then install a node version via nvm. Finally install npm via that node version to keep it outside of homebrew. You might have to uninstall your node modules from homebrew before, of course. See https://stackoverflow.com/a/28025834 for details.

Community
  • 1
  • 1
morgler
  • 1,289
  • 11
  • 23