Ionic run android - Operation Not Permitted

I have tried creating a brand new app, removing ionic and cordova, updating them, removing the plugins and whenever I run the ionic run android command I get something like this:

    $ ionic run android
    • You're trying to build for android but don't have the platform installed yet.
    ∆ Installing android for you.
    Installing cordova-plugin-device
    Installing cordova-plugin-console
    Installing cordova-plugin-whitelist
    Installing cordova-plugin-splashscreen
    Installing cordova-plugin-statusbar
    Installing ionic-plugin-keyboard
     Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "cordova plugin add --save cordova-plugin-splashscreen"
    C:\Users\SCL\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\node_modules\configstore\index.js:    69
                                    throw err;

Error: EPERM: operation not permitted, rename 'C:\Users\SCL\.config\configstore\insight-cordova.json.1857746170' -> 'C:\Users\SCL\.config\configstore\insight-cordova.json'
    at Error (native)
    at Object.fs.renameSync (fs.js:681:18)
    at Function.writeFileSync [as sync] (C:\Users\SCL\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\node_modules\configstore\node_modules\write-file-atomic\index.js:81:8)
    at Object.create.all.set (C:\Users\SCL\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\node_modules\configstore\index.js:62:21)
    at Object.Configstore (C:\Users\SCL\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\node_modules\configstore\index.js:27:11)
    at new Insight (C:\Users\SCL\AppData\Roaming\npm\node_modules\cordova\node_modules\insight\lib\index.js:38:34)
    at Object.<anonymous> (C:\Users\SCL\AppData\Roaming\npm\node_modules\cordova\src\telemetry.js:37:15)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Could you solve it?, I’m having the same problem.


the error is
You’re trying to build for android but don’t have the platform installed yet.

so did you run the

ionic add platform android

before you try to deploy
and did also make sure that you install all android sdk tools

Yeah I did, actualy I ran ‘cordova build android’ and ’ cordova run android’ and it worked, it seems that my problem is with a permission, so I went to my folder and it has the only read property, I’m trying to figure out how to change that, I’m using windows 10 and the attrib command is not workin so I’ll be trying to change that. Thanks!

try also to run

ionic hooks add

You can use it as follows:


/p : Set new permission
/e : Edit permission and kept old permission as it is i.e. edit ACL instead of replacing it.
{USERNAME} : Name of user
{PERMISSION} : Permission can be:
R – Read
W – Write
C – Change (write)
F – Full control
For example grant Rocky Full (F) control with following command (type at Windows command prompt):

C:> CACLS files /e /p rocky:f

1 Like

thanks for your help, I did all you said, but I kept having an error, finally I ended up analyzing all the project and saw that it was in a folder with the same name, so I placed it in another folder with another name, and it worked, I appreciate your help thanks.

1 Like

Hi, getting the same error. what did you move to another folder to get your project working ?

Change permission of file located in C:\Users\USER_NAME.config\configstore\update-notifier-cordova.json and try again.
Solved to me.:blush:

1 Like

Please elaborate, I’m a noob sorry. I also suffer the same problem.