运行“ember服务器”失败,错误 [英] Running "ember server" fails with error
问题描述
我正在尝试在本地运行一个现有的ember应用程序进行开发,但是当我从应用程序目录中运行ember server时,我收到以下错误:
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'
按此线程 https://github.com/stefanpenner/ember-cli/issues/381 我尝试执行以下操作:
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
请注意,我不得不在所有npm命令以及rm -rf node_modules之前使用sudo。我也试过这个线程 https://github.com/bower/bower/issues/475再次使用sudo:
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
但没有一个工作,我仍然得到相同的错误。我刚刚使用所有这些Ember工具,即npm,bower,ember-cli等,并且有一种感觉,如果我不得不一直使用sudo,在安装过程中做错了事情。建议如何解决这个错误?
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?
推荐答案
好的,我有同样的问题,解决方法是以下几点。在你的命令行(假设一个类Unix系统):
Ok, I had the same issue and the way to fix is is the following. In your command line (assuming a unix-like system):
将所有者权限添加到npm: sudo chown -R $(whoami)〜/ .npm
Add owner permission to npm: sudo chown -R $(whoami) ~/.npm
现在,如果 bower
也会导致您出现问题,解决这个问题是要清除保险箱缓存(如 @torazaburo ):
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
或者您可以手动执行:
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
希望这有帮助...
这篇关于运行“ember服务器”失败,错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!