I cannot install cordova-res

I have tried many codes,

npm i -g cordova-res
npm i -g ionic cordova-res
npm install cordova-res-generator -g

cordova-res-generator

ionic cordova resources --cordova-res

Though my ionic info remains,

Ionic:

Ionic CLI : 5.0.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.5.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

Cordova:

Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 4 other plugins)

Utility:

cordova-res : not installed
native-run : not installed

System:

Android SDK Tools : 26.1.1 (/Users/Camila/Library/Android/sdk/)
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave

How do I fix this?

This is may be related to how Node was installed on your machine. You can either update your permissions or use a node version manager.

I had the same issue, and went the permissions route:
$ id -un (to get your USERNAME)
matt

then use it with:
$ sudo chown -R USERNAME /usr/local/lib/node_modules/

$ npm install -g cordova-res

8 Likes

I finally fixed it with some differences to your code.

Thanks!

1 Like

Thank you so much, it works for me

Thank you so much!!!

can u show what u did

Thank you very much!!! this really helped me

Thanks so much Matt!!:grinning:

As there is CLI error when trying to install for that fixed that with the help of Fixed kodak printer not printing black ink helped me to solve this.

thanks a lot, its worked