Keystone-classic: Error: EACCES, permission denied '/root/.config/configstore/insight-yo.json'

Created on 1 Aug 2015  Â·  36Comments  Â·  Source: keystonejs/keystone-classic

On Fedora 24 i get:

$yo keystone

Error: EACCES, permission denied '/root/.config/configstore/insight-yo.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/yo/node_modules/configstore/index.js:27:26)
at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:20:44)
at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
at Object.<anonymous> (/usr/lib/node_modules/yo/lib/cli.js:130: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)

Most helpful comment

Fixed this with: chmod g+rwx /root /root/.config /root/.config/configstore

All 36 comments

Looks like you installed some of your node dependencies with sudo. Check out: http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo

I installed every from root on this VM sever :(

In that case just run:

$sudo yo keystone

sudo yo keystone

Error: EACCES, permission denied '/root/.config/configstore/insight-yo.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/yo/node_modules/configstore/index.js:27:26)
at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:20:44)
at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
at Object. (/usr/lib/node_modules/yo/lib/cli.js:130: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)

Unfortunately it didn't helped. I think I will reinstall everything as a normale user but I fear a lot of people have this issue.

Also tried:

chown root:root /root/.config/ -R
yo keystone

Error: EACCES, permission denied '/root/.config/configstore/insight-yo.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/yo/node_modules/configstore/index.js:27:26)
at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:20:44)
at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
at Object.<anonymous> (/usr/lib/node_modules/yo/lib/cli.js:130: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)

You should take this to the generator repo:
https://github.com/keystonejs/generator-keystone

Look into how permissions work on a Fedora box. Something tells me it's not the yeoman generator but your security on Fedora.

same problem:(

same problem in docker container

same propblem on ubuntu. I used sudo everywhere

have you all tried using nvm? see the issue this was moved to @yzzhuo @thatgreenguy @ubermensh

same problem on mint

Fixed this with: chmod g+rwx /root /root/.config /root/.config/configstore

Thanks, it really helps

In fact, '/root/.config/configstore/insight-yo.json' doesn't exist.

In order to make this working in a Docker Alpine Linux container, you need to

  mkdir -p /root/.config/configstore
  chmod g+rwx /root /root/.config /root/.config/configstore

Confirmed this behaviour from the official Docker image for Node.

Just do it

chmod g+rwx /root /root/.config /root/.config/configstore/*

same problem in Debian 8
i did.

mkdir -p /root/.config/configstore
chmod g+rwx /root /root/.config /root/.config/configstore

Hey @borissoto , did you try to run "npm install -g generator-webapp" ?
It works to me.

Those who encouter this issue, if you have a desktop environment on your linux :

  • Open the direction '/root/.config/configstore' as a root
  • Right click 'insight-yo.json' file -> Properties
  • In 'permissions' tab, change every 'Access' methods to 'Read and Write'

Hi..

How to do it using bash?

On 12 June 2017 at 10:06, Berk Sevgi notifications@github.com wrote:

Those who encouter this issue, if you have a desktop environment on your
linux :

  • Open the direction '/root/.config/configstore' as a root
  • Right click 'insight-yo.json' file -> Properties
  • In 'permissions' tab, change every 'Access' methods to 'Read and
    Write'

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/keystonejs/keystone/issues/1566#issuecomment-307783327,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAUHiUAKGxht5fCrp3iHR34CO84yBDcQks5sDTfDgaJpZM4Fj_J0
.

--
Tarcísio Costa Corte
e-mail: [email protected] tarcisiocorte@gmail.com
Skype: tarcisiocorte
Phone: +55 (11) 9 7786 4190

(on CentOS 6.9) Even if I change permissions on /root/.config/configstore/insight-yo.json, when I use yo loopback:model these permissions are overwritten and the error comes back...

I have Ubuntu 16.04.2 LTS Xenial Xerus. Same issue as described above. None of the above answers worked for me. For some reason, sudo apt install nodejs was installing old (v4) version of Nodejs . Solved the issue by installing Node Version Manager (nvm) and using latest stable version of Nodejs (right now it is v6.11.0). I'll describe the process here (mind that I am using apt that was introduced in Xenial Xerus):

  1. First things first:
    $ sudo apt update && sudo apt upgrade
  2. Install libssl-dev & build-essential _(we need those to build nvm from source)_:
    $ sudo apt install build-essential libssl-dev
  3. Grab installation script from github nvm repo
    $ curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh -o install_nvm.sh
    You can check the script contents with nano or vim (Myself? I prefer vim): vim install_nvm.sh
  4. Run the Script!
    $ bash install_nvm.sh
    after nvm is installed, you'll have to re-login, _or_ you can use $ source ~/.profile & stay in the session.
    Also, you can check available versions of Nodejs with $ nvm ls-remote (LTSs are prefixed with v)
  5. Install Nodejs LTS $ nvm install v6.11.0, and finally $ nvm use v6.11.0.
    After that - check the version of Nodejs with $ node -v

Hope it helps.

_PS_
Use $ nvm -help for extra information on nvm usage.

I have the same problem.Everytime I use yoman command,such as yo -v,the /root/.config/configstore/insight-yo.json file will be created ,and the auth is -rw-------.So it's useless to change the auth.I also tried to change the umask,but it didn't work.By the way,I use Ubuntu 16.04 LST.

Yeoman's CLI tool is highly opinionated and does not document that it uses https://www.npmjs.com/package/root-check to prevent being run by the root user.

mlb - this has fixed it for me. i was running with su.

I had the same issue inside my docker container. I solved it by setting XDG_CONFIG_HOME variable of the configstore package to a config path inside my app directory. eg export XDG_CONFIG_HOME=/home/code/app/yo_config/ or inside the Dockerfile ENV XDG_CONFIG_HOME=/home/code/app/yo_config/

Where /home/code is the WORKDIR in my docker image.

had the same issue. $ sudo chmod 777 /home/{yourUserName}/.config/configstore/ /home/{yourUserName}/ .config/configstore/insight-yo.json - solved problem.

I had the same issue here is the solution for it - here it is :)
https://gist.github.com/Jay991/4275c5e5f11741a7f9b3743da3110976

Hi All,

I had the same issue. Using root, I tried to change the permissions of the insight-yo.json file as mentioned above but observed that whenever I ran the "yo hubot", it again the replace the file permissions to 300.

Finally as mentioned by Jay991, I tried to run the same command by a user with sudo privileges but without the sudo command & it was successful.

When I ran "sudo yo hubot", it threw the same error. But when I ran the "yo hubot" directly, it worked properly.

i have some problem, and i try above solutions now that not working for me.

I Solve it by changeing the owner fom root to my username
sudo chown -R me:me /home/me/.config/configstore/
change me with your username and group .

you can use this ~$ sudo chmod 777 -R ~/.config/configstore

npm install -g truffle did not work for me on Manjaro

So I tried sudo npm install -g truffle and was getting thesame EACESS, permission denied error as above

Then I did sudo npm install --unsafe-perm=true --allow-root truffle as suggested on a Stackoverflow post

And it probably worked

sudo npm install --unsafe-perm=true --allow-root truffle

> [email protected] postinstall /home/kshitij/node_modules/truffle
> node ./scripts/postinstall.js

- Fetching solc version list from solc-bin. Attempt #1
- Downloading compiler. Attempt #1
npm WARN saveError ENOENT: no such file or directory, open '/home/kshitij/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/kshitij/package.json'
npm WARN kshitij No description
npm WARN kshitij No repository field.
npm WARN kshitij No README data
npm WARN kshitij No license field.

+ [email protected]
added 25 packages from 437 contributors and audited 127 packages in 55.565s
found 3 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Was this page helpful?
0 / 5 - 0 ratings

Related issues

stennie picture stennie  Â·  5Comments

jacqueslareau picture jacqueslareau  Â·  5Comments

celiao picture celiao  Â·  4Comments

josephg picture josephg  Â·  4Comments

koenoe picture koenoe  Â·  4Comments