4

I tried running

yo angular --coffee --minsafe

but I get this error

   Error: EACCES, permission denied '/Users/Basil/.config/configstore/insight-yo.yml'
        at Object.fs.openSync (fs.js:427:18)
        at Object.fs.writeFileSync (fs.js:966:15)
        at Object.create.all.set (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:39:7)
        at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:30:11)
        at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/insight.js:20:16)
        at Object.<anonymous> (/usr/local/lib/node_modules/yo/bin/yo:26:15)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)

I have checked the issues on Github and seen npm / yeoman install generator-angular without sudo but can't seem to get it to work

node v0.10.17 npm v1.2.10

find / -name 'yeoman'

/Users/Basil/.node/node_modules/.bin/yeoman /Users/Basil/.node/node_modules/yeoman /Users/Basil/.node/node_modules/yeoman/bin/yeoman /Users/Basil/.node/node_modules/yeoman/node_modules/yeoman-generators/lib/generators/yeoman /Users/Basil/.npm/yeoman /Users/Basil/.npm/yeoman/0.9.6/package/bin/yeoman /Users/Basil/.npm/yeoman-generators/0.9.5/package/lib/generators/yeoman

Community
  • 1
  • 1
bsiddiqui
  • 1,886
  • 5
  • 25
  • 35

8 Answers8

11

I was able to fix this issue with this:

Sudo chown Basil /Users/Basil/.config/configstore/update-notifier-yo.yml

If you run into this issue, try this out, replacing "Basil" with your username

pedrommuller
  • 15,741
  • 10
  • 76
  • 126
bsiddiqui
  • 1,886
  • 5
  • 25
  • 35
  • FYI - had to remove the file name to get it to work - meaning, gave my user access to the folder /configstore/ not necessarily to the file itself. – itamar Jan 22 '15 at 03:43
7

You can just use npm cache clean and bower cache clean.

Weafs.py
  • 22,731
  • 9
  • 56
  • 78
Fadel
  • 701
  • 10
  • 12
1

Sudo chown Basil /Users/Basil/.config/configstore/update-notifier-yo.yml (Remove trailing chown) Replace Basil with your username.

Sudo chown <yourusername> /Users/<yourusername>/.config/configstore/update-notifier-yo.yml Keepinging in mind your username does not include the dollar sign.

This corrected the Error when running Yeoman:

EACCES, permission denied '/Users/<yourusername>/.config/configstore/update-notifier-yo.yml'
postjoe
  • 11
  • 1
1

If the above doesn't work simply delete all files in the /Users/USER_NAME/.config/configstore/ directory and run yo angular again. Replace USER_NAME with your user name.

  • Not sure why that worked, but it did. I chown'd the to user and root in my case, and still no dice. But for some reason when I deleted the files and re-ran my yo command it worked great. Thanks for the tip. – Justin Sep 09 '14 at 13:15
0

I just fixed it in Windows. I have done three things, which one have fixed it I am not sure.

  1. Run cmd prompt as administrator.

  2. takeown /? this command is equivalent to chown (linux) but for windows.

  3. cacls -cacls /E /T /G :F

  4. simply go in $USER /Users/calvin/.config/configstore/ and make files unhidden.

it worked for me like charm. I have been trying to fix this since many days.

Deepak K
  • 329
  • 3
  • 11
0

This is probably too late to answer but in order to help others, changing both permissions (chmod) and owner (chown) is what worked for me on Ubuntu:

sudo chmod g+rwx /home/myusername/.config/configstore
sudo chown myusername /home/myusername/.config/configstore
Bahman_Aries
  • 4,658
  • 6
  • 36
  • 60
0

This one worked for me :

//Update npm to the latest version. Works for to upgrade 1.x to 2.x.
$ npm install -g npm stable    
// Assign group permissions to the parent directory.
$ chmod g+rwx /root /root/.config /root/.config/configstore
JDurstberger
  • 4,127
  • 8
  • 31
  • 68
Puru
  • 1
0

you can simply remove the .config folder from user home directory rm -rf /home/user/.config then run sudo yo which will create .config again and reset previous faulty configuration. Mine is working fine after apply this approach.

theshemul
  • 388
  • 1
  • 6
  • 15