no puedo instalar ionic

-when I run npm install -g ionic it shows me the following error
-cuando ejecuto npm install -g ionic me muestra el siguiente error.

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/Administrador/.npm/_cacache/content-v2/sha1/a3/50’

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T04_47_03_501Z-debug.log

Welcome @carlos1229! There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your install again:


sudo chown -R $(whoami) ~/.npm

The long version and canonical bug is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.

Ahora me muestra este error
Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/Administrador/.npm/_cacache/content-v2/sha1/a3/50’

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! <https://npm.community>

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T04_47_03_501Z-debug.log

MacBook-Air-de-Administrador:~ Administrador$ npm install -g ionic cordova

Unhandled rejection Error: EACCES: permission denied, rename ‘/Users/Administrador/.npm/_cacache/tmp/61bd3566’ -> ‘/Users/Administrador/.npm/_cacache/content-v2/sha1/a3/50/08b20f41383eec1fb914f4cd5df79a264284’

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! <https://npm.community>

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T05_03_33_202Z-debug.log

MacBook-Air-de-Administrador:~ Administrador$ npm install -g ionic

Unhandled rejection Error: EACCES: permission denied, rename ‘/Users/Administrador/.npm/_cacache/tmp/b2030f75’ -> ‘/Users/Administrador/.npm/_cacache/content-v2/sha1/a3/50/08b20f41383eec1fb914f4cd5df79a264284’

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! <https://npm.community>

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T05_06_38_884Z-debug.log

MacBook-Air-de-Administrador:~ Administrador$ sudo chown -R $(whoami) ~/.npm

Password:

MacBook-Air-de-Administrador:~ Administrador$ npm install -g ionic

npm ERR! path /Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall rmdir

npm ERR! Error: EACCES: permission denied, rmdir ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’

npm ERR! { Error: EACCES: permission denied, rmdir ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’

npm ERR! stack: ‘Error: EACCES: permission denied, rmdir ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’’,

npm ERR! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘rmdir’,

npm ERR! path: ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’ }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T05_07_53_626Z-debug.log

MacBook-Air-de-Administrador:~ Administrador$ sudo chown -R $(whoami) /usr/local/lib

MacBook-Air-de-Administrador:~ Administrador$ sudo chown -R $(whoami) /usr/local/bin

MacBook-Air-de-Administrador:~ Administrador$ clear

MacBook-Air-de-Administrador:~ Administrador$ npm install -g ionic

npm ERR! path /Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall rmdir

npm ERR! Error: EACCES: permission denied, rmdir ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’

npm ERR! { Error: EACCES: permission denied, rmdir ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’

npm ERR! stack: ‘Error: EACCES: permission denied, rmdir ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’’,

npm ERR! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘rmdir’,

npm ERR! path: ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/abbrev-b6d7bd7d’ }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T05_10_22_289Z-debug.log

Another directory because you have custom prefix:

sudo chown -R $(whoami) ~/.npm-global
npm install -g ionic

Hola John ahora me sale esto

npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/rxjs-774a5ee3/util’

npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/.npm-global/lib/node_modules/.staging/rxjs-774a5ee3/webSocket’

npm ERR! path /Users/Administrador/.npm-global/lib/node_modules/ionic/node_modules/esprima/bin/esparse.js

npm ERR! code ENOENT

npm ERR! errno -2

npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod ‘/Users/Administrador/.npm-global/lib/node_modules/ionic/node_modules/esprima/bin/esparse.js’

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T05_30_27_211Z-debug.log

ejecuto sudo npm install ionic@3.2.0 --save y me muestra esto en consola
npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/node_modules/.staging/ionic-e127a000/bin’

npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/node_modules/.staging/ionic-e127a000/dist’

npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/node_modules/.staging/ionic-e127a000/dist/commands’

npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/node_modules/.staging/ionic-e127a000/dist/commands/package’

npm WARN tar EISDIR: illegal operation on a directory, open ‘/Users/Administrador/node_modules/.staging/ionic-e127a000/dist/lib’

npm WARN enoent ENOENT: no such file or directory, open ‘/Users/Administrador/package.json’

npm WARN @ionic/cli-utils@1.2.0 requires a peer of strip-ansi@^3.0.1 but none is installed. You must install peer dependencies yourself.

npm WARN Administrador No description

npm WARN Administrador No repository field.

npm WARN Administrador No README data

npm WARN Administrador No license field.

npm ERR! path /Users/Administrador/node_modules/ionic/bin/ionic

npm ERR! code ENOENT

npm ERR! errno -2

npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod ‘/Users/Administrador/node_modules/ionic/bin/ionic’

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Administrador/.npm/_logs/2019-03-14T05_35_58_682Z-debug.log

I am out of suggestions. Few questions:

npm prefix --global
?
npm config get cache
?
ls -al /Users/Administrador/node_modules/.staging/ionic-e127a000/dist
?
npm --versions
?

Muchas gracias John por la ayuda todo se ejecuto bien, me puedes ayudar con este error al generar el apk, escribo en consola ionic cordova build android y me muestra el siguiente error.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 21s
23 actionable tasks: 23 executed
/Users/Administrador/Documents/1.ionic_3_proyectos/roller/taxiappdescargado/Projects/User/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/Administrador/Documents/1.ionic_3_proyectos/roller/taxiappdescargado/Projects/User/platforms/android/app/src/main/AndroidManifest.xml:50:5-74 Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:tbxml-android:] /Users/Administrador/.gradle/caches/transforms-1/files-1.1/tbxml-android.aar/ee9cf98847ee1906ad8f30329aab642d/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project’s minSdk version to at least 19,
or use tools:overrideLibrary=“za.co.twyst” to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:processDebugManifest’.

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:tbxml-android:] /Users/Administrador/.gradle/caches/transforms-1/files-1.1/tbxml-android.aar/ee9cf98847ee1906ad8f30329aab642d/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project’s minSdk version to at least 19,
or use tools:overrideLibrary=“za.co.twyst” to force usage (may lead to runtime failures)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 21s
[ERROR] An error occurred while running subprocess cordova.

    cordova build android exited with exit code 1.
    
    Re-running this command with the --verbose flag may provide more 
    information.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.