Question

hubot rocket.chat adapter install permission problem

When i get to the step of sudo yo hubot --owner="OWNER <owner@example.com>" --name="bot" --description="Bot" --adapter="rocketchat@0.1" , PuTTY gave me error saying i don’t have permission to some npm file, I researched online, looks like it is a common problem. So i used https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-2-change-npms-default-directory-to-another-directory Option 1 to change the permission

and this is what i got from PuTTY, I get the feel this is the right direction, but detail is wrong, can anyone tell me what went wrong?

jy@ubuntu-1gb-sfo2-01:~$ npm config get prefix
/usr/local
jy@ubuntu-1gb-sfo2-01:~$ sudo chown -R $jy /usr/local/lib/node_modules/
[sudo] password for jy:
chown: missing operand after ‘/usr/local/lib/node_modules/’
Try 'chown --help' for more information.

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
October 12, 2016
Accepted Answer

In the page you linked a recommendation is given to chown the contents of the directory you are wanting to work with. In the example it included:

 sudo chown -R $(whoami)

In this instance $(whoami) will be automatically replaced by the username you are using. If your username is jk then you could use:

sudo chown -R jy /usr/local/lib/node_modules/

Without the $.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.