Reputation: 75
I tried running
npm install -g cordova
but it cannot install it, must have "sudo" before it. This lead to when I want to add a new project I have to run
sudo cordova create
But it cannot run, it said ANDROID_HOME is not set. When I run
sudo -i
to run with root, it can run find. I have edit .bashrc for /root/ and /home/myUser/
So, how can I install cordova with
npm install -g cordova
?
Upvotes: 0
Views: 1041
Reputation: 2052
Since ANDROID_HOME
is not set in your root's environment variables.
Either
append ANDROID_HOME="Path to your sdk"
to /root/.bashrc
or
use sudo -E
instead of sudo
which will use your environment variables.
Remember second option assumes that you have ANDROID_HOME
set in your bashrc
.
Upvotes: 1
Reputation: 6029
You will want to change the owner of the path where cordova is installed and possibly change the owner of the path you will be building in.
For cordova:
sudo chown -R {your_user_name} /path/to/where/cordova/installed
And then the same on the path where your app projects will be:
sudo chown -R {your_user_name} /path/to/app/project
Upvotes: 2