npm access permission issue when install hubot adapter

Posted October 13, 2016 2.7k views

got npm access permission issue when i was installing hubot RC adapter by following this tutorial, when i did yo hubot --owner="OWNER <>" --name="bot" --description="Bot" --adapter="rocketchat@0.1", gave me errors as below:
“`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” “–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/hubot/npm-debug.log`“

I tried sudo chown -R jy /usr/local/lib/node_modules/, still have the same error message. what is next i can do? NVM?

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
1 answer

This is resolved, pls don’t reply. Thanks