antoniputra
antoniputra

Reputation: 4361

Cannot install gruntjs (always created nested folders)

I had install node and npm in my ubuntu 12.04.

I am following this for installation that : https://gist.github.com/isaacs/579814 (used the top one) worked successfully

and when I am install grunt in my terminal at home directory path :

npm install -g grunt-cli

and here the results : http://pastebin.com/R3zP55Z2

at seen that had many created nested folder : "/home/antoni/[sudo] password for antoni:"

I didn't know where my faults.

can someone tell me.

thanks a million.

Upvotes: 1

Views: 83

Answers (2)

MattGoldspink
MattGoldspink

Reputation: 351

It looks like you don't have permissions to write to that directory. I would firstly check if you have permissions to write the directory:

ls -la /home/antoni/local

If you do have the right permission you should see something like drwxr-xr-x and your username. The key being the w character in the third column. If for some reason the directory doesn't have drwxr-xr-x then chmod it to add write permissions:

chmod -R 755 /home/antoni/local

Or if the current owner is wrong then try running:

chown -R $USER /home/antoni/local

You may need to use sudo for these. After that check you can write to it by running:

touch /home/antoni/local/test.txt

If that fails then there is still a problem with the permissions (perhaps previous commands failed). If that works and it still doesn't install then have a look at where npm is trying to write to:

npm bin -g
npm root -g

These 2 directories are where npm will install the components of grunt-cli. It's worth checking to make sure these 2 directories are writable by you to also.

Upvotes: 1

antoniputra
antoniputra

Reputation: 4361

solved. I do like at this answer : npm global path prefix

I am wrong in my prefix npm. before I set in home/ dir. that make npm created many nested folder. (I still dunno why ?)

and then, I fix that problem to do something like this in terminal :

sudo chown $USER:$USER /usr/local
npm config set prefix /usr/local

Horray !! :D

Upvotes: 1

Related Questions