Ionic install issue osx

Hi, I have same problem of first message in this topic. I have OS X 10.10.5, i have repaired permission in utility and in recovery mode, using sudo doesn’t work the command

sudo npm install -g cordova ionic

all software needed are installed, in $PATH is present the directory usr/local/lib

Password:
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.0","npm":"2.14.7"})

> spawn-sync@1.0.13 postinstall /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:424
    var path = (i >= 0) ? arguments[i] : process.cwd();
                                                 ^

Error: EACCES: permission denied, uv_cwd
    at Error (native)
    at Object.posix.resolve (path.js:424:50)
    at startup (node.js:93:32)
    at node.js:961:3
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova

> node-sass@3.3.3 install /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass
> node scripts/install.js

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:424
    var path = (i >= 0) ? arguments[i] : process.cwd();
                                                 ^

Error: EACCES: permission denied, uv_cwd
    at Error (native)
    at Object.posix.resolve (path.js:424:50)
    at startup (node.js:93:32)
    at node.js:961:3
npm WARN engine cordova-js@4.0.0: wanted: {"node":"~0.10.x"} (current: {"node":"4.2.0","npm":"2.14.7"})
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.0","npm":"2.14.7"})
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v4.2.0
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! spawn-sync@1.0.13 postinstall: `node postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.13 postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/davideandreoli/npm-debug.log`

HELP ME!

I SOLVED

i needed to repair the permissions during install:

i launch this command

sudo npm install --global --unsafe-perm quickscrape

so it’s download a package and installed that fix problems, so the line “updated”

sudo npm install -g cordova ionic --unsafe-perm quickscrape

FINALLY INSTALLED SUCCESFULLY!

5 Likes

I am having the same issue and will try the same. Can others confirm this is the “correct” fix for this?

This did work for me, although have zero idea about what this “–unsafe-perm quickscrape” does actually.

This also worked for me. I was having trouble with the sass and spawn-sync modules, but this command worked.

1 Like

Thanks. I was also having issues with node-sass, solved it with:
sudo npm install -g ionic --unsafe-perm node-sass

Works great with this. Remember to also use what @Avilagab wrote at the end as well.

I published the complete solution here: https://medium.com/@gautham.gg/how-to-install-ionic-on-mac-without-issues-3efe92a0da93#.yh5zsay13

So if you are having issues you might wanna check it out.

Prerequisite: npm must be installed. You can check this by entering this command: ‘npm -v’. This should give you the version number. If not please install them.

Now lets fix the issue.

First launch this command:

sudo npm install --global --unsafe-perm quickscrape

Then, launch this command:

sudo npm install -g cordova ionic --unsafe-perm quickscrape

Now, run this command:

sudo npm install -g ionic --unsafe-perm node-sass

Once I did this, Ionic worked beautifully. This was done on a MacBook Pro (Retina, 13-inch, Late 2012), running OSX El Capitan 10.11.2.
I’m not sure if Windows users have any issues with this, but I believe that you should remove the ‘sudo’ if you are doing this on windows.

Now that you have followed my steps, both Ionic and Cordova should be installed, and working. Start by creating a blank Ionic project:

ionic start myApp blank

1 Like

HI EVERYBODY ,i have same problem in installing ionic.
i try install ionic2 on el capitan 10.11.1 when i try to install with this commandnpm install -g ionic cordova or any command that exist on this page unfortunately not work .
error that i Deal with it :

npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm ERR! Darwin 15.0.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “ionic” "cordova"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9

npm ERR! Invalid name: "@ionic/app-generators"
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/mohamad/npm-debug.log.

plz answer me quickly

Hi i have the same problem trying to install ionic on my mac

sudo npm -g install ionic
Error: EPERM: operation not permitted, mkdir '/usr/loca’
at Error (native)
npm -v
3.10.10
sudo npm install --global --unsafe-perm quickscrape
Error: EPERM: operation not permitted, mkdir '/usr/loca’
at Error (native)

Someone can help