2

Last week I started tinkering with the Ember framework. I really started to like it however, when I tried to run any Ember-CLI command with ember <command> it threw the following error at me:

/usr/lib/node_modules/ember-cli/node_modules/configstore/index.js:46
            throw err;
                  ^
Error: EACCES, permission denied '/home/mattias/.config/configstore/ember-cli.json'
You don't have access to this file.

at Object.fs.openSync (fs.js:439:18)
at Object.fs.readFileSync (fs.js:290:15)
at Object.create.all.get (/usr/lib/node_modules/ember-cli/node_modules/configstore/index.js:27:26)
at Object.Configstore (/usr/lib/node_modules/ember-cli/node_modules/configstore/index.js:20:44)
at clientId (/usr/lib/node_modules/ember-cli/lib/cli/index.js:22:21)
at module.exports (/usr/lib/node_modules/ember-cli/lib/cli/index.js:64:19)
at /usr/lib/node_modules/ember-cli/bin/ember:26:3
at /usr/lib/node_modules/ember-cli/node_modules/resolve/lib/async.js:46:14
at process (/usr/lib/node_modules/ember-cli/node_modules/resolve/lib/async.js:173:43)
at ondir (/usr/lib/node_modules/ember-cli/node_modules/resolve/lib/async.js:188:17)

At first I thought it had something to do with Ember or npm, so I tried reinstalling npm, NodeJS, and Ember, however it always gave back the error whenever I wanted to use the Ember-CLI.

Thanks for the suggestions.

Mattias Zurkovic
  • 335
  • 3
  • 12
  • 1
    Did you possibly install Ember CLI with `sudo`? You could take a look at the permissions, or if you want to start over, just do something like `/usr/lib/node_modules/ember-cli` (might have to `sudo` if your permissions are messed up) and then `npm install -g ember-cli`. – SeeMeCode Feb 09 '16 at 01:11
  • See also https://docs.npmjs.com/getting-started/fixing-npm-permissions – locks Feb 09 '16 at 02:37
  • 2
    Possible duplicate of [NPM throws error without sudo](http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo) – locks Feb 09 '16 at 12:13
  • If your using sublime text, try close it before you run the command i have some weird issues then sublime has dist and tmp in the project at least for ember serve – Christian Stengel Feb 09 '16 at 16:46

3 Answers3

3

Change the permissions of the .config/configstore

sudo chmod -R 777 /home/MyUsername/.config/configstore

If you are concerned about security you can later change permissions.

sudo chmod -R 771 /users/MyUsername/.config/configstore
Azmat Rana
  • 532
  • 3
  • 11
2

This continues to be an issue every time I upgrade. I did this and it seemed to do the trick:

sudo chmod g+rwx /[username]/.config /[username]/.config/configstore /[username]/.config/configstore/ember-cli.json

I try to avoid installing ember-cli with sudo and just give any file it complains about elevated chown permissions.

Next time I run into this I'm going to try closing the open files in my editor as I do wonder if that is the issue.

Branden Silva
  • 1,406
  • 1
  • 11
  • 15
1

I was experiencing a similar issue, I used sudo npm install -g ember-cli and that worked.

That's for OS X. it puts the terminal into admin mode. As in Windows you should open git bash or cmd line as administrator.

Zach
  • 11
  • 2