1
votes

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?

4

4 Answers

1
votes

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 ...

0
votes

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.

0
votes

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

sudo ember server

0
votes

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.