hubot- adapter installing problem

Posted October 11, 2016 3.4k views

I am installing adapter using “add adapter to hubot” section. when i get to the step of
yo hubot –owner=“OWNER” –name=“bot” –description=“Bot” –adapter=“rocketchat”, i got error message:

npm ERR! Linux 4.4.0-38-generic
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “hubot” “hubot-scripts” “hubot-diagnostics” “hubot-help” “hubot-heroku-keepalive” “hubot-google-images” “hubot-google-translate” “hubot-pugme” “hubot-maps” “hubot-redis-brain” “hubot-rules” “hubot-shipit” “hubot-rocketchat@1.0.5” “–save”
npm ERR! node v4.5.0
npm ERR! npm v3.10.8
npm ERR! path /home/jy/.npm/commander/2.6.0
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir ’/home/jy/.npm/commander/2.6.0’
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir ’/home/jy/.npm/commander/2.6.0’]
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: 'mkdir’,
npm ERR! path: ’/home/jy/.npm/commander/2.6.0’,
npm ERR! parent: 'express’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /home/jy/usor/npm-debug.log

I tried use Root to do it, it gave me error:
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/local/lib/nodemodules/yo/nodemodules/configstore/index.js:34:26)
at Object.Configstore (/usr/local/lib/nodemodules/yo/nodemodules/configstore/index.js:27:44)
at new Insight (/usr/local/lib/nodemodules/yo/nodemodules/insight/lib/index.js:37:34)
at Object.<anonymous> (/usr/local/lib/nodemodules/yo/lib/cli.js:172:11)
at Module.
compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
root@ubuntu-1gb-sfo2-01:~/usor# node -v
root@ubuntu-1gb-sfo2-01:~/usor# npm -v

I get the feel it is the access problem, i tried sudo chmod g+rwx /root /root/.config /root/.config/configstore, it says the directory doesn’t exist. What will be the best way to resolve this? Installing NVM? if so, what else do i need to do?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

This is an odd issue. Since the root user should have the permissions by default to write to directories under ~/.config and based on the other message you mentioned I wonder if /root/.config/configstore doesn’t exist.

I am guessing that this may be because you ran the first couple commands as a regular user so the needed directories were not created in the /root path. I would make sure you are root and start from the beginning.

Thanks for the quick response. I started as regular user and used sudo, then i changed to root and start all over, still give me the permission issue.