简体   繁体   中英

EACCES error using Yeoman to install angular

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

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

你可以使用npm cache cleanbower cache clean

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'

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.

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.

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM