Linux : add android platform to cordova

2019-07-03 04:22发布

问题:

When I add android platform to my project by issuing the command:

cordova platform add android

I get the following error :

Unable to fetch platform android: Error: EACCES, mkdir '/home/mo3tssem/tmp/npm-13061-R9BWhlB2'

回答1:

Okay, so your /home/ubuntu/tmp has wrong permissions. It happened because you did sudo npm install in the past, and npm doesn't handle this well enough.

Run sudo chown ubuntu /home/ubuntu/tmp -Rv to fix this issue, or just delete that folder.



回答2:

run this first:

ln -s /tmp $HOME/tmp