I am using a fresh install of Debian 8 Jessie. I installed Nginx, Nodejs 4x,NPM,and MongoDB. I attempted to install Yeoman with npm install -g yo
. I pressed enter to output yo-complete to STDOUT. I then ran yo-complete
. Next i installed npm install -g generator-keystone
. When i try to use the generator yo keystone
in a project i get the following error message:
/usr/lib/node_modules/yo/node_modules/configstore/index.js:53
throw err;
^
Error: EACCES: permission denied, open '/root/.config/configstore/insight-yo.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.create.all.get (/usr/lib/node_modules/yo/node_modules/configstore/index.js:34:26)
at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:27: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:163:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
FYI, I am logged in as root, but i understand the problem is that npm runs as no user/group. I never had this problem on ubuntu, but for whatever reason i'm having it now on Jessie. I am at a loss for where i should start in trying to resolve this issue.
As it turns out, my issue was being logged in as root.
i did the following steps:
apt-get autoremove nodejs
adduser dev
fill out user details in promptvisudo
and uncomment the line allowing sudo group to execute commands as root.usermod -aG sudo dev
add user to sudo groupsu - dev
switch to dev usersudo apt install nodejs
sudo npm install -g npm
to update npmsudo npm install -g yo
reinstall yoWorked like a charm, Yo is working with no problems now.